Skip to content

Commit

Permalink
add sorting for list blobs (#14322)
Browse files Browse the repository at this point in the history
Signed-off-by: Wang Yan <[email protected]>
  • Loading branch information
wy65701436 authored Mar 4, 2021
1 parent 21dc98a commit 155f438
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/pkg/blob/dao/dao.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ func (d *dao) ListBlobs(ctx context.Context, query *q.Query) ([]*models.Blob, er
return nil, err
}

if query.Sorting != "" {
qs = qs.OrderBy(query.Sorting)
}
blobs := []*models.Blob{}
if _, err = qs.All(&blobs); err != nil {
return nil, err
Expand Down

0 comments on commit 155f438

Please sign in to comment.