mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-24 07:15:43 +00:00
feat(BE-281): adjustment bug erorr 500 if 404 record projectflock
This commit is contained in:
@@ -959,6 +959,9 @@ func (s projectflockService) ensureProjectFlockKandangProductWarehouses(ctx cont
|
|||||||
|
|
||||||
warehouse, err := warehouseRepo.GetByKandangID(ctx, record.KandangId)
|
warehouse, err := warehouseRepo.GetByKandangID(ctx, record.KandangId)
|
||||||
if err != nil {
|
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
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user