From 15df62e239d161bf9015c3594e642ae04db962cb Mon Sep 17 00:00:00 2001 From: Josepablo C Date: Tue, 3 Sep 2024 12:34:18 -0600 Subject: [PATCH] fix(notifications): Adding desc order (latests first) --- v1/src/apps/private/notifications/services.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/v1/src/apps/private/notifications/services.js b/v1/src/apps/private/notifications/services.js index e81eeeb..eb0dcec 100644 --- a/v1/src/apps/private/notifications/services.js +++ b/v1/src/apps/private/notifications/services.js @@ -8,7 +8,9 @@ async function getNotifications(req, res, next) { const list = await Notifications.find( { owner : userId, deleted : false - } ); + } ).sort({ + "createdAt":'desc' + }); return res.send( list ); }catch(error){ console.error( error );