mirror of
https://github.com/goharbor/harbor.git
synced 2024-09-27 13:02:59 +02:00
remove query.Sorting from registration.go
Signed-off-by: Divya Pamecha <21123621+Its-Maniaco@users.noreply.github.com>
This commit is contained in:
parent
f910c5654b
commit
75df6195ac
@ -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
Block a user