From 91bdc053bc93aa942091cdd11c2c8e3d44411ccc Mon Sep 17 00:00:00 2001 From: Matt Roberts Date: Thu, 10 Oct 2024 11:36:58 +0100 Subject: [PATCH] Order notifications by date desc --- app/services/sqlstore/postgres/notification.go | 1 + 1 file changed, 1 insertion(+) diff --git a/app/services/sqlstore/postgres/notification.go b/app/services/sqlstore/postgres/notification.go index 473a9fce2..f5f724b10 100644 --- a/app/services/sqlstore/postgres/notification.go +++ b/app/services/sqlstore/postgres/notification.go @@ -108,6 +108,7 @@ func getActiveNotifications(ctx context.Context, q *query.GetActiveNotifications LEFT JOIN users u ON u.id = n.author_id WHERE n.tenant_id = $1 AND n.user_id = $2 AND (n.read = false OR n.updated_at > CURRENT_DATE - INTERVAL '30 days') + ORDER BY n.updated_at DESC `, tenant.ID, user.ID) if err != nil { return errors.Wrap(err, "failed to get active notifications")