🐛 Fix whats new missing preloading

This commit is contained in:
LittleSheep 2024-09-03 22:54:11 +08:00
parent 7044907a4a
commit 56def6ea2c

View File

@ -50,12 +50,12 @@ func getWhatsNew(c *fiber.Ctx) error {
var items []models.Event var items []models.Event
if err := database.C. if err := database.C.
Where("channel_id IN ?", lookupRange).
Limit(take). Limit(take).
Order("created_at DESC"). Order("created_at DESC").
Preload("Sender"). Preload("Sender").
Preload("Sender.Account"). Preload("Sender.Account").
Preload("Channel"). Preload("Channel").
Preload("Channel.Realm").
Find(&items).Error; err != nil { Find(&items).Error; err != nil {
return fiber.NewError(fiber.StatusBadRequest, err.Error()) return fiber.NewError(fiber.StatusBadRequest, err.Error())
} }