feat: enhance GetAll method to preload InvIssue along with Client
Deploy Application / deploy (push) Successful in 20s Details

This commit is contained in:
Habib Fatkhul Rohman 2025-12-09 15:18:31 +07:00
parent afec1c2750
commit cb85352475
1 changed files with 4 additions and 1 deletions

View File

@ -67,7 +67,10 @@ func (r *inventoryReturnRepository) GetAll(ctx context.Context, filter query.Inv
if filter.PerPage > 0 && filter.Page > 0 {
db = db.Offset((filter.Page - 1) * filter.PerPage).Limit(filter.PerPage)
}
if err := db.Preload("Client").Find(&returns).Error; err != nil {
if err := db.
Preload("Client").
Preload("InvIssue").
Find(&returns).Error; err != nil {
return returns, total, err
}
return returns, total, nil