fix(notifications): Adding desc order (latests first)

This commit is contained in:
Josepablo C
2024-09-03 12:34:18 -06:00
parent 5a492e7c46
commit 15df62e239

View File

@@ -8,7 +8,9 @@ async function getNotifications(req, res, next) {
const list = await Notifications.find( { const list = await Notifications.find( {
owner : userId, owner : userId,
deleted : false deleted : false
} ); } ).sort({
"createdAt":'desc'
});
return res.send( list ); return res.send( list );
}catch(error){ }catch(error){
console.error( error ); console.error( error );