From 38e5a9544f102c98006bd6f9d2f751f0e2995b6e Mon Sep 17 00:00:00 2001 From: Toaster2 Date: Fri, 17 Apr 2026 16:56:58 +0200 Subject: [PATCH] Sort notifications by newest --- Refresh.Database/GameDatabaseContext.Notifications.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Refresh.Database/GameDatabaseContext.Notifications.cs b/Refresh.Database/GameDatabaseContext.Notifications.cs index a9d2cbaa..79e56aa1 100644 --- a/Refresh.Database/GameDatabaseContext.Notifications.cs +++ b/Refresh.Database/GameDatabaseContext.Notifications.cs @@ -57,8 +57,10 @@ public int GetNotificationCountByUser(GameUser user) => .Count(n => n.User == user); [Pure] - public DatabaseList GetNotificationsByUser(GameUser user, int count, int skip) => - new(this.GameNotifications.Where(n => n.User == user), skip, count); + public DatabaseList GetNotificationsByUser(GameUser user, int count, int skip) + => new(this.GameNotifications + .Where(n => n.UserId == user.UserId) + .OrderByDescending(n => n.CreatedAt), skip, count); [Pure] public GameNotification? GetNotificationByUuid(GameUser user, ObjectId id)