fix(BE): improve product and warehouse existence check in adjustment service

This commit is contained in:
aguhh18
2025-10-17 20:43:31 +07:00
parent 79700420d4
commit a45c20d2ff
2 changed files with 25 additions and 2 deletions
@@ -72,6 +72,11 @@ func (s productWarehouseService) GetAll(c *fiber.Ctx, params *validation.Query)
s.Log.Errorf("Failed to get productWarehouses: %+v", err)
return nil, 0, err
}
if len(productWarehouses) == 0 {
return nil, 0, fiber.NewError(fiber.StatusNotFound, "ProductWarehouses not found")
}
return productWarehouses, total, nil
}