diff --git a/app/Entities/Equipment/ServerEntity.php b/app/Entities/Equipment/ServerEntity.php index 03c0cf7..39095fd 100644 --- a/app/Entities/Equipment/ServerEntity.php +++ b/app/Entities/Equipment/ServerEntity.php @@ -81,7 +81,8 @@ class ServerEntity extends EquipmentEntity } public function getIP(): ?string { - return $this->ip ?? null; + $val = $this->ip ?? null; + return ($val === '' || $val === null) ? null : $val; } public function getViewer(): ?string @@ -103,6 +104,7 @@ class ServerEntity extends EquipmentEntity } public function getFormatAt(): ?string { - return $this->format_at ?? null; + $val = $this->format_at ?? null; + return ($val === '' || $val === null) ? null : $val; } } diff --git a/app/Services/Equipment/ServerService.php b/app/Services/Equipment/ServerService.php index 5a7e51e..98f4f33 100644 --- a/app/Services/Equipment/ServerService.php +++ b/app/Services/Equipment/ServerService.php @@ -167,7 +167,7 @@ class ServerService extends EquipmentService //기존 IP 제거 service('part_ipservice')->detachFromServer($oldEntity); //새로운 IP 추가 (IP가 정의 되어 있으면) - if ($entity->getIP()) { + if ($entity->getIP() !== null) { service('part_ipservice')->attachToServer($entity); } } @@ -175,7 +175,7 @@ class ServerService extends EquipmentService if ($oldEntity->getSwitchInfoUid() !== $entity->getSwitchInfoUid()) { service('part_switchservice')->detachFromServer($oldEntity); //새로운 Switch 추가 (Switch가 정의 되어 있으면) - if ($entity->getSwitchInfoUid()) { + if ($entity->getSwitchInfoUid() !== null) { service('part_switchservice')->attachToServer($entity); } } @@ -183,7 +183,7 @@ class ServerService extends EquipmentService if ($oldEntity->getChassisInfoUid() !== $entity->getChassisInfoUid()) { service('equipment_chassisservice')->detachFromServer($oldEntity); //새로운 Chassis 추가 (Chassis가 정의 되어 있으면) - if ($entity->getChassisInfoUid()) { + if ($entity->getChassisInfoUid() !== null) { service('equipment_chassisservice')->attachToServer($entity); } }