From ab565f136955ab50ba4df97e986fa02ed5b4876f Mon Sep 17 00:00:00 2001 From: philipp Date: Thu, 28 Mar 2024 08:10:26 +0100 Subject: [PATCH] show new notifications @ top --- src/model/notification.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/model/notification.rs b/src/model/notification.rs index 8cfc6a1..3268e6d 100644 --- a/src/model/notification.rs +++ b/src/model/notification.rs @@ -58,7 +58,7 @@ impl Notification { pub async fn for_user(db: &SqlitePool, user: &User) -> Vec { sqlx::query_as!( Self, - "SELECT * FROM notification WHERE user_id = ?", + "SELECT * FROM notification WHERE user_id = ? ORDER BY created_at DESC", user.id ) .fetch_all(db) -- 2.45.2