🐛 Bug fixes on post freezed data didn't update

This commit is contained in:
2024-12-16 21:37:19 +08:00
parent ade3dbdeee
commit 710e2dc040
3 changed files with 11 additions and 9 deletions

View File

@@ -22,11 +22,11 @@ func GetAccountWithID(id uint) (models.Publisher, error) {
func ModifyPosterVoteCount(user models.Publisher, isUpvote bool, delta int) error {
if isUpvote {
user.TotalUpvote += delta
return database.C.Model(&user).Update("total_upvote", user.TotalUpvote).Error
} else {
user.TotalDownvote += delta
return database.C.Model(&user).Update("total_downvote", user.TotalDownvote).Error
}
return database.C.Save(&user).Error
}
func NotifyPosterAccount(pub models.Publisher, post models.Post, title, body, topic string, subtitle ...string) error {