fix(be): nonstock response supplier null to empty array

This commit is contained in:
Hafizh A. Y
2025-12-31 06:52:38 +07:00
parent 6c42119f4d
commit 5302713811
@@ -101,7 +101,7 @@ func ToNonstockDetailDTO(e entity.Nonstock) NonstockDetailDTO {
func toNonstockSupplierDTOs(relations []entity.NonstockSupplier) []supplierDTO.SupplierRelationDTO { func toNonstockSupplierDTOs(relations []entity.NonstockSupplier) []supplierDTO.SupplierRelationDTO {
if len(relations) == 0 { if len(relations) == 0 {
return nil return make([]supplierDTO.SupplierRelationDTO, 0)
} }
result := make([]supplierDTO.SupplierRelationDTO, 0, len(relations)) result := make([]supplierDTO.SupplierRelationDTO, 0, len(relations))
@@ -113,7 +113,7 @@ func toNonstockSupplierDTOs(relations []entity.NonstockSupplier) []supplierDTO.S
} }
if len(result) == 0 { if len(result) == 0 {
return nil return make([]supplierDTO.SupplierRelationDTO, 0)
} }
return result return result