From 7c528facf9c1516c3413107790a7c9fd97acd4bc Mon Sep 17 00:00:00 2001 From: lejianwen <84855512@qq.com> Date: Mon, 20 Jan 2025 13:07:41 +0800 Subject: [PATCH] fix(api): Change tag to alphabetical sorting Fixes: #108 --- service/tag.go | 1 + 1 file changed, 1 insertion(+) diff --git a/service/tag.go b/service/tag.go index e9fc089..355733e 100644 --- a/service/tag.go +++ b/service/tag.go @@ -29,6 +29,7 @@ func (s *TagService) ListByUserId(userId uint) (res *model.TagList) { func (s *TagService) ListByUserIdAndCollectionId(userId, cid uint) (res *model.TagList) { res = s.List(1, 1000, func(tx *gorm.DB) { tx.Where("user_id = ? and collection_id = ?", userId, cid) + tx.Order("name asc") }) return }