Skip to content

Commit

Permalink
removed query.sorting
Browse files Browse the repository at this point in the history
Signed-off-by: Its-Maniaco <[email protected]>
  • Loading branch information
Its-Maniaco committed Jul 22, 2024
1 parent cc70ebb commit 62e31ad
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/pkg/scan/dao/scanner/registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,22 +121,6 @@ func ListRegistrations(ctx context.Context, query *q.Query) ([]*Registration, er
if err != nil {
return nil, err
}

// Order the list
if len(query.Sorts) > 0 {
sortKey := ""
for _, sort := range query.Sorts {
if sort.DESC {
sortKey += " -" + sort.Key
} else {
sortKey += " " + sort.Key
}
}
qs = qs.OrderBy(sortKey)
} else {
qs = qs.OrderBy("-is_default", "-create_time") // -column means descending
}

l := make([]*Registration, 0)
_, err = qs.All(&l)

Expand Down

0 comments on commit 62e31ad

Please sign in to comment.