Eager to load realms

🐛 Trying to fix empty reactions list
This commit is contained in:
2025-03-30 15:05:04 +08:00
parent ce9d663bc3
commit 6f7a2de41e
2 changed files with 39 additions and 14 deletions

View File

@@ -428,7 +428,7 @@ func ListPost(tx *gorm.DB, take int, offset int, order any, user *uint, noReact
itemMap := make(map[uint]*models.Post, len(posts))
for i, item := range posts {
idx[i] = item.ID
itemMap[item.ID] = &item
itemMap[item.ID] = &posts[i]
}
// Batch load reactions