adjust after getuk updated

This commit is contained in:
dpurbosakti
2025-10-11 10:34:52 +07:00
parent 5f88e912c8
commit 1e77a82866
201 changed files with 347 additions and 1275 deletions

No files matched your search

@@ -107,9 +107,6 @@ func ReadList(input e.ReadListDto) (*d.Data, error) {
return err
}
if len(input.Includes) > 0 {
input.Preloads = pu.GetPreloads(input.Includes)
}
if dataList, metaList, err = ReadListData(input, &event, tx); err != nil {
return err
}
+3 -14
View File
@@ -47,14 +47,9 @@ func ReadListData(input e.ReadListDto, event *pl.Event, dbx ...*gorm.DB) ([]e.So
tx = dg.I
}
if len(input.Preloads) > 0 {
for _, preload := range input.Preloads {
tx = tx.Preload(preload)
}
}
tx = tx.
Model(&e.Soapi{}).
Scopes(gh.Preload(input.Includes)).
Scopes(gh.Filter(input.FilterDto)).
Count(&count).
Scopes(gh.Paginate(input, &pagination)).
@@ -64,15 +59,9 @@ func ReadListData(input e.ReadListDto, event *pl.Event, dbx ...*gorm.DB) ([]e.So
if err == gorm.ErrRecordNotFound {
return nil, &meta, nil
}
event.Status = "failed"
event.ErrInfo = pl.ErrorInfo{
Code: "data-get-fail",
Detail: "Database get failed",
Raw: err,
}
return nil, nil, pl.SetLogError(event, input)
return nil, nil, plh.HandleListError(input, event, err)
}
meta.Count = int(count)
meta.PageNumber = pagination.PageNumber
meta.PageSize = pagination.PageSize