feat: add ReadUsersNotifications fn

This commit is contained in:
zkldi
2022-04-24 21:12:29 +01:00
parent c1f5da3cce
commit 2fbd56472d
@@ -35,6 +35,19 @@ export function ReadNotification(notifID: string) {
);
}
/**
* Mark all of a user's notifications as read.
*/
export function ReadUsersNotifications(userID: integer) {
return db.notifications.update(
{ sentTo: userID },
{
$set: { read: true },
},
{ multi: true }
);
}
export function DeleteNotification(notifID: string) {
return db.notifications.remove({ notifID });
}