fix logic

This commit is contained in:
areeqakbr 2025-06-16 10:57:27 +07:00
parent 0bf5aa1991
commit 7905cdb4f0
1 changed files with 4 additions and 2 deletions

View File

@ -48,9 +48,11 @@ func (u *deviceUseCase) CreateDeviceWithMultipleImages(device req.DeviceDTO, ima
return fmt.Errorf("validation error: %w", err)
}
if device.DeviceType == "OTB" || device.DeviceType == "ODP" && device.PortAmount <= 0 {
if device.DeviceType == "OTB" || device.DeviceType == "ODP" {
if device.PortAmount <= 0 {
return fmt.Errorf("port amount must be greater than 0 for OTB or ODP devices")
}
}
var imageURLs []string
var primaryImageURL string