feat: update GetAllByIssueId method to use correct column name and enhance preload relationships
This commit is contained in:
parent
95ce47a406
commit
a6eb6c6ca0
|
|
@ -48,7 +48,13 @@ func (r *inventoryIssueLineRepository) GetById(ctx context.Context, tx *gorm.DB,
|
||||||
|
|
||||||
func (r *inventoryIssueLineRepository) GetAllByIssueId(ctx context.Context, issueId string) ([]entities.TInventoryIssueLineEntity, error) {
|
func (r *inventoryIssueLineRepository) GetAllByIssueId(ctx context.Context, issueId string) ([]entities.TInventoryIssueLineEntity, error) {
|
||||||
var lines []entities.TInventoryIssueLineEntity
|
var lines []entities.TInventoryIssueLineEntity
|
||||||
if err := r.db.WithContext(ctx).Where("issue_id = ?", issueId).Preload("Product").Preload("Warehouse").Preload("Issue").Preload("Client").Find(&lines).Error; err != nil {
|
if err := r.db.WithContext(ctx).
|
||||||
|
Where("inv_issue_id = ?", issueId).
|
||||||
|
Preload("Product").
|
||||||
|
Preload("Warehouse").
|
||||||
|
Preload("InvIssue").
|
||||||
|
Preload("Client").
|
||||||
|
Find(&lines).Error; err != nil {
|
||||||
return lines, err
|
return lines, err
|
||||||
}
|
}
|
||||||
return lines, nil
|
return lines, nil
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue