support changing primary category for transaction category

This commit is contained in:
MaysWind
2024-06-23 23:37:58 +08:00
parent 9627e65d6d
commit 0e391bee50
12 changed files with 166 additions and 28 deletions
+1 -1
View File
@@ -249,7 +249,7 @@ func (s *TransactionCategoryService) ModifyCategory(c *core.Context, category *m
category.UpdatedUnixTime = time.Now().Unix()
return s.UserDataDB(category.Uid).DoTransaction(c, func(sess *xorm.Session) error {
updatedRows, err := sess.ID(category.CategoryId).Cols("name", "icon", "color", "comment", "hidden", "updated_unix_time").Where("uid=? AND deleted=?", category.Uid, false).Update(category)
updatedRows, err := sess.ID(category.CategoryId).Cols("parent_category_id", "name", "icon", "color", "comment", "hidden", "updated_unix_time").Where("uid=? AND deleted=?", category.Uid, false).Update(category)
if err != nil {
return err