feat: enhance GetById method to preload Product, Product.Uom, InvReturn, and Client
Deploy Application / deploy (push) Successful in 19s
Details
Deploy Application / deploy (push) Successful in 19s
Details
This commit is contained in:
parent
472bcd5d3e
commit
38d05c95ea
|
|
@ -76,7 +76,12 @@ func (r *inventoryReturnLineRepository) GetById(ctx context.Context, tx *gorm.DB
|
|||
tx = r.db
|
||||
}
|
||||
var line entities.TInventoryReturnLineEntity
|
||||
if err := tx.WithContext(ctx).First(&line, "id = ?", id).Error; err != nil {
|
||||
if err := tx.WithContext(ctx).
|
||||
Preload("Product").
|
||||
Preload("Product.Uom").
|
||||
Preload("InvReturn").
|
||||
Preload("Client").
|
||||
First(&line, "id = ?", id).Error; err != nil {
|
||||
return line, err
|
||||
}
|
||||
return line, nil
|
||||
|
|
|
|||
Loading…
Reference in New Issue