From 5302713811af99a07327838994749575182cf7a5 Mon Sep 17 00:00:00 2001 From: "Hafizh A. Y" Date: Wed, 31 Dec 2025 06:52:38 +0700 Subject: [PATCH] fix(be): nonstock response supplier null to empty array --- internal/modules/master/nonstocks/dto/nonstock.dto.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/modules/master/nonstocks/dto/nonstock.dto.go b/internal/modules/master/nonstocks/dto/nonstock.dto.go index 71e1bb20..9954ee76 100644 --- a/internal/modules/master/nonstocks/dto/nonstock.dto.go +++ b/internal/modules/master/nonstocks/dto/nonstock.dto.go @@ -101,7 +101,7 @@ func ToNonstockDetailDTO(e entity.Nonstock) NonstockDetailDTO { func toNonstockSupplierDTOs(relations []entity.NonstockSupplier) []supplierDTO.SupplierRelationDTO { if len(relations) == 0 { - return nil + return make([]supplierDTO.SupplierRelationDTO, 0) } result := make([]supplierDTO.SupplierRelationDTO, 0, len(relations)) @@ -113,7 +113,7 @@ func toNonstockSupplierDTOs(relations []entity.NonstockSupplier) []supplierDTO.S } if len(result) == 0 { - return nil + return make([]supplierDTO.SupplierRelationDTO, 0) } return result