mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 18:25:56 +01:00
Merge pull request #14014 from wy65701436/fixes-13985
fix robot list issue
This commit is contained in:
commit
f31f861e90
@ -119,6 +119,9 @@ func (d *dao) List(ctx context.Context, query *q.Query) ([]*model.Robot, error)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if query.Sorting != "" {
|
||||
qs = qs.OrderBy(query.Sorting)
|
||||
}
|
||||
if _, err = qs.All(&robots); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -81,5 +81,9 @@ func (m *manager) Update(ctx context.Context, r *model.Robot, props ...string) e
|
||||
|
||||
// List ...
|
||||
func (m *manager) List(ctx context.Context, query *q.Query) ([]*model.Robot, error) {
|
||||
query = q.MustClone(query)
|
||||
if query.Sorting == "" {
|
||||
query.Sorting = "name"
|
||||
}
|
||||
return m.dao.List(ctx, query)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user