feat(BE-281): adjustment bug erorr 500 if 404 record projectflock

This commit is contained in:
ragilap
2025-12-31 07:39:20 +07:00
parent d994cfdce7
commit 709e304f7f
@@ -959,6 +959,9 @@ func (s projectflockService) ensureProjectFlockKandangProductWarehouses(ctx cont
warehouse, err := warehouseRepo.GetByKandangID(ctx, record.KandangId)
if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
return fiber.NewError(fiber.StatusBadRequest, fmt.Sprintf("Warehouse untuk kandang %d belum tersedia", record.KandangId))
}
return err
}