From 68d7c7a698229979c26388d8342964e47e19109f Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sun, 6 Dec 2020 20:28:08 +0800 Subject: [PATCH] code refactor --- pkg/services/transaction_tags.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/services/transaction_tags.go b/pkg/services/transaction_tags.go index 04ae8767..ec953f1c 100644 --- a/pkg/services/transaction_tags.go +++ b/pkg/services/transaction_tags.go @@ -183,10 +183,8 @@ func (s *TransactionTagService) DeleteTags(uid int64, ids []int64) error { return errs.ErrUserIdInvalid } - tag := &models.TransactionTag{} - return s.UserDataDB(uid).DoTransaction(func(sess *xorm.Session) error { - deletedRows, err := sess.In("tag_id", ids).Where("uid=?", uid).Delete(tag) + deletedRows, err := sess.In("tag_id", ids).Where("uid=?", uid).Delete(&models.TransactionTag{}) if err != nil { return err