🐛 Fix setting post total upvote wrong
This commit is contained in:
parent
34d166bec8
commit
c31d390a0b
@ -520,7 +520,7 @@ func ReactPost(user authm.Account, reaction models.Reaction) (bool, models.React
|
||||
|
||||
if reaction.Attitude == models.AttitudePositive {
|
||||
op.TotalUpvote++
|
||||
database.C.Model(&op).Update("total_upvote", op.TotalDownvote)
|
||||
database.C.Model(&op).Update("total_upvote", op.TotalUpvote)
|
||||
} else {
|
||||
op.TotalDownvote++
|
||||
database.C.Model(&op).Update("total_downvote", op.TotalDownvote)
|
||||
@ -538,7 +538,7 @@ func ReactPost(user authm.Account, reaction models.Reaction) (bool, models.React
|
||||
|
||||
if reaction.Attitude == models.AttitudePositive {
|
||||
op.TotalUpvote--
|
||||
database.C.Model(&op).Update("total_upvote", op.TotalDownvote)
|
||||
database.C.Model(&op).Update("total_upvote", op.TotalUpvote)
|
||||
} else {
|
||||
op.TotalDownvote--
|
||||
database.C.Model(&op).Update("total_downvote", op.TotalDownvote)
|
||||
|
Loading…
Reference in New Issue
Block a user