fix(notifications): Adding desc order (latests first)
This commit is contained in:
@@ -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 );
|
||||||
|
|||||||
Reference in New Issue
Block a user