feat (unit, division-position): add preload

This commit is contained in:
dpurbosakti
2025-08-20 13:53:14 +07:00
parent 4c25bdf8db
commit a218489496
6 changed files with 84 additions and 5 deletions

No files matched your search

@@ -40,6 +40,7 @@ func ReadListData(input e.ReadListDto, dbx ...*gorm.DB) ([]e.DivisionPosition, *
Model(&e.DivisionPosition{}).
// Joins("Patient"). // if needed
// Preload("Patient"). // if needed
Preload("Division"). // if needed
Scopes(gh.Filter(input)).
Count(&count).
Scopes(gh.Paginate(input, &pagination)).
@@ -40,6 +40,7 @@ func ReadListData(input e.ReadListDto, dbx ...*gorm.DB) ([]e.Unit, *e.MetaDto, e
Model(&e.Unit{}).
// Joins("Patient"). // if needed
// Preload("Patient"). // if needed
Preload("Installation"). // if needed
Scopes(gh.Filter(input)).
Count(&count).
Scopes(gh.Paginate(input, &pagination)).