mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-25 07:45:44 +00:00
feat(BE-116): add project chick in database schema
This commit is contained in:
@@ -35,9 +35,12 @@ func NewProductWarehouseService(repo repository.ProductWarehouseRepository, vali
|
||||
|
||||
func (s productWarehouseService) withRelations(db *gorm.DB) *gorm.DB {
|
||||
return db.
|
||||
Preload("Product.Flags").
|
||||
Preload("Product").
|
||||
Preload("Product.Flags").
|
||||
Preload("Warehouse").
|
||||
Preload("Warehouse.Location").
|
||||
Preload("Warehouse.Kandang").
|
||||
Preload("Warehouse.Area").
|
||||
Preload("CreatedUser")
|
||||
}
|
||||
|
||||
@@ -85,6 +88,7 @@ func (s productWarehouseService) GetOne(c *fiber.Ctx, id uint) (*entity.ProductW
|
||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
return nil, fiber.NewError(fiber.StatusNotFound, "ProductWarehouse not found")
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
s.Log.Errorf("Failed get productWarehouse by id: %+v", err)
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user