aboutsummaryrefslogtreecommitdiffstats
path: root/models/user.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-03-31 17:20:39 +0800
committerGitHub <noreply@github.com>2022-03-31 17:20:39 +0800
commitd4f84f1c937e24e71aa5f05c58d440cde741450f (patch)
tree18571ad08fabe6d1090ea4d2674beab3b1c00a6e /models/user.go
parent43332a483f7838df66e0209eb9c15d4aba3d5874 (diff)
downloadgitea-d4f84f1c937e24e71aa5f05c58d440cde741450f.tar.gz
gitea-d4f84f1c937e24e71aa5f05c58d440cde741450f.zip
Move reaction to models/issues/ (#19264)
* Move reaction to models/issues/ * Fix test * move the function * improve code * Update models/issues/reaction.go Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'models/user.go')
-rw-r--r--models/user.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/models/user.go b/models/user.go
index 7744222809..e830779629 100644
--- a/models/user.go
+++ b/models/user.go
@@ -14,6 +14,7 @@ import (
asymkey_model "code.gitea.io/gitea/models/asymkey"
"code.gitea.io/gitea/models/db"
+ "code.gitea.io/gitea/models/issues"
"code.gitea.io/gitea/models/organization"
repo_model "code.gitea.io/gitea/models/repo"
user_model "code.gitea.io/gitea/models/user"
@@ -76,7 +77,7 @@ func DeleteUser(ctx context.Context, u *user_model.User) (err error) {
&IssueUser{UID: u.ID},
&user_model.EmailAddress{UID: u.ID},
&user_model.UserOpenID{UID: u.ID},
- &Reaction{UserID: u.ID},
+ &issues.Reaction{UserID: u.ID},
&organization.TeamUser{UID: u.ID},
&Collaboration{UserID: u.ID},
&Stopwatch{UserID: u.ID},
@@ -100,14 +101,14 @@ func DeleteUser(ctx context.Context, u *user_model.User) (err error) {
}
for _, comment := range comments {
- if err = deleteComment(e, comment); err != nil {
+ if err = deleteComment(ctx, comment); err != nil {
return err
}
}
}
// Delete Reactions
- if err = deleteReaction(e, &ReactionOptions{Doer: u}); err != nil {
+ if err = issues.DeleteReaction(ctx, &issues.ReactionOptions{DoerID: u.ID}); err != nil {
return err
}
}