adjust after getuk updated
This commit is contained in:
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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user