feat: enhance GetAll method to preload InvIssue along with Client
Deploy Application / deploy (push) Successful in 20s
Details
Deploy Application / deploy (push) Successful in 20s
Details
This commit is contained in:
parent
afec1c2750
commit
cb85352475
|
|
@ -67,7 +67,10 @@ func (r *inventoryReturnRepository) GetAll(ctx context.Context, filter query.Inv
|
||||||
if filter.PerPage > 0 && filter.Page > 0 {
|
if filter.PerPage > 0 && filter.Page > 0 {
|
||||||
db = db.Offset((filter.Page - 1) * filter.PerPage).Limit(filter.PerPage)
|
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, err
|
||||||
}
|
}
|
||||||
return returns, total, nil
|
return returns, total, nil
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue