🐛 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 {
|
if reaction.Attitude == models.AttitudePositive {
|
||||||
op.TotalUpvote++
|
op.TotalUpvote++
|
||||||
database.C.Model(&op).Update("total_upvote", op.TotalDownvote)
|
database.C.Model(&op).Update("total_upvote", op.TotalUpvote)
|
||||||
} else {
|
} else {
|
||||||
op.TotalDownvote++
|
op.TotalDownvote++
|
||||||
database.C.Model(&op).Update("total_downvote", 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 {
|
if reaction.Attitude == models.AttitudePositive {
|
||||||
op.TotalUpvote--
|
op.TotalUpvote--
|
||||||
database.C.Model(&op).Update("total_upvote", op.TotalDownvote)
|
database.C.Model(&op).Update("total_upvote", op.TotalUpvote)
|
||||||
} else {
|
} else {
|
||||||
op.TotalDownvote--
|
op.TotalDownvote--
|
||||||
database.C.Model(&op).Update("total_downvote", op.TotalDownvote)
|
database.C.Model(&op).Update("total_downvote", op.TotalDownvote)
|
||||||
|
Loading…
Reference in New Issue
Block a user