mirror of https://github.com/goharbor/harbor.git
Merge 0ccb46dfc0
into 7306f6d7d9
This commit is contained in:
commit
1ad476e4a9
|
@ -123,8 +123,14 @@ func ListRegistrations(ctx context.Context, query *q.Query) ([]*Registration, er
|
|||
}
|
||||
|
||||
// Order the list
|
||||
if query.Sorting != "" {
|
||||
qs = qs.OrderBy(query.Sorting)
|
||||
if len(query.Sorts) > 0 {
|
||||
for _, sort := range query.Sorts {
|
||||
sortKey := sort.Key
|
||||
if sort.DESC {
|
||||
sortKey += " DESC"
|
||||
}
|
||||
qs = qs.OrderBy(sortKey)
|
||||
}
|
||||
} else {
|
||||
qs = qs.OrderBy("-is_default", "-create_time")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue