feat: enhance GetById method to preload Product, Product.Uom, InvReturn, and Client
Deploy Application / deploy (push) Successful in 19s Details

This commit is contained in:
Habib Fatkhul Rohman 2025-12-09 15:58:40 +07:00
parent 472bcd5d3e
commit 38d05c95ea
1 changed files with 6 additions and 1 deletions

View File

@ -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