🐛 Fix notification order

This commit is contained in:
2024-10-16 20:57:08 +08:00
parent 29629cead6
commit 10d977ab23
2 changed files with 5 additions and 5 deletions

View File

@ -32,7 +32,7 @@ func getNotifications(c *fiber.Ctx) error {
if err := tx.
Limit(take).
Offset(offset).
Order("CASE WHEN read_at IS NULL THEN 0 ELSE 1 END, created_at").
Order("read_at DESC, created_at").
Find(&notifications).Error; err != nil {
return fiber.NewError(fiber.StatusInternalServerError, err.Error())
}