Просмотр исходного кода

fix(api): Change tag to alphabetical sorting

Fixes: #108
lejianwen 1 год назад
Родитель
Сommit
f4cb9beda5
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      service/tag.go

+ 1 - 0
service/tag.go

@@ -29,6 +29,7 @@ func (s *TagService) ListByUserId(userId uint) (res *model.TagList) {
29
 func (s *TagService) ListByUserIdAndCollectionId(userId, cid uint) (res *model.TagList) {
29
 func (s *TagService) ListByUserIdAndCollectionId(userId, cid uint) (res *model.TagList) {
30
 	res = s.List(1, 1000, func(tx *gorm.DB) {
30
 	res = s.List(1, 1000, func(tx *gorm.DB) {
31
 		tx.Where("user_id = ? and collection_id = ?", userId, cid)
31
 		tx.Where("user_id = ? and collection_id = ?", userId, cid)
32
+		tx.Order("name asc")
32
 	})
33
 	})
33
 	return
34
 	return
34
 }
35
 }