diff --git a/app/Services/Equipment/ServerService.php b/app/Services/Equipment/ServerService.php index 9a595c8..91fec44 100644 --- a/app/Services/Equipment/ServerService.php +++ b/app/Services/Equipment/ServerService.php @@ -149,14 +149,18 @@ class ServerService extends EquipmentService } if ($oldEntity->getIP() !== $entity->getIP()) { - service('part_ipservice')->detachFromServer($oldEntity); + if (!$oldEntity->getIP()) { //null이거나 공백인경우 + service('part_ipservice')->detachFromServer($oldEntity); + } if ($entity->getIP() !== null) { service('part_ipservice')->attachToServer($entity); } } if ($oldEntity->getSwitchInfoUid() !== $entity->getSwitchInfoUid()) { - service('part_switchservice')->detachFromServer($oldEntity); + if (!$oldEntity->getSwitchInfoUid()) { //null이거나 공백인경우 + service('part_switchservice')->detachFromServer($oldEntity); + } if ($entity->getSwitchInfoUid() !== null) { service('part_switchservice')->attachToServer($entity); } @@ -169,7 +173,7 @@ class ServerService extends EquipmentService } } - // ✅ 서비스 유지중이면 정상 동기화 (해지 시는 deatchFromService에서 따로 처리) + // ✅ 서비스 유지중이면 정상 동기화 (해지 시는 detachFromService에서 따로 처리) if ($entity->getServiceInfoUid() !== null) { $serviceEntity = service('customer_serviceservice')->getEntity($entity->getServiceInfoUid()); if (!$serviceEntity instanceof ServiceEntity) {