Skip to content

Commit 33495ce

Browse files
committed
fix migrator add/delete reaction
1 parent e2f7527 commit 33495ce

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

models/issue_reaction.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ func (opts *FindReactionsOptions) toConds() builder.Cond {
5151
cond = cond.And(builder.Eq{"reaction.comment_id": 0})
5252
}
5353
if opts.UserID > 0 {
54-
cond = cond.And(builder.Eq{"reaction.user_id": opts.UserID})
54+
cond = cond.And(builder.Eq{
55+
"reaction.user_id": opts.UserID,
56+
"reaction.original_author_id": 0,
57+
})
5558
}
5659
if opts.Reaction != "" {
5760
cond = cond.And(builder.Eq{"reaction.type": opts.Reaction})
@@ -175,7 +178,7 @@ func deleteReaction(e *xorm.Session, opts *ReactionOptions) error {
175178
if opts.Comment != nil {
176179
reaction.CommentID = opts.Comment.ID
177180
}
178-
_, err := e.Delete(reaction)
181+
_, err := e.Where("original_author_id = 0").Delete(reaction)
179182
return err
180183
}
181184

0 commit comments

Comments
 (0)