Merge pull request #14319 from wy65701436/fix-blob-sorting

add sorting for list blobs
This commit is contained in:
Wenkai Yin(尹文开) 2021-02-26 14:13:36 +08:00 committed by GitHub
commit 43a7fad93c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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