From 155f43824174da30773786e4addaa1e886560688 Mon Sep 17 00:00:00 2001 From: Wang Yan Date: Thu, 4 Mar 2021 13:23:20 +0800 Subject: [PATCH] add sorting for list blobs (#14322) Signed-off-by: Wang Yan --- src/pkg/blob/dao/dao.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pkg/blob/dao/dao.go b/src/pkg/blob/dao/dao.go index dd4bca8ecd7..3bebaa5d1ce 100644 --- a/src/pkg/blob/dao/dao.go +++ b/src/pkg/blob/dao/dao.go @@ -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