🐛 Trying to fix batch list reactions of post miscounted

This commit is contained in:
2024-10-13 13:37:11 +08:00
parent f86a7527a9
commit db85cebe06
3 changed files with 5 additions and 5 deletions

View File

@@ -194,7 +194,7 @@ func ListPost(tx *gorm.DB, take int, offset int, order any, noReact ...bool) ([]
// Load reactions
if len(noReact) <= 0 || !noReact[0] {
if mapping, err := BatchListResourceReactions(database.C.Where("post_id IN ?", idx), "post_id"); err != nil {
if mapping, err := BatchListPostReactions(database.C.Where("post_id IN ?", idx), "post_id"); err != nil {
return items, err
} else {
itemMap := lo.SliceToMap(items, func(item *models.Post) (uint, *models.Post) {