diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-05-29 01:22:39 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-05-29 01:22:39 +0900 |
| commit | ab16fb3a3fff96a4fa2bc1fc0e56a87c129a4625 (patch) | |
| tree | 26de7290eede6b42a661f328adce965a889f9887 /src/server/api/endpoints/notifications/get_unread_count.ts | |
| parent | typo (diff) | |
| download | sharkey-ab16fb3a3fff96a4fa2bc1fc0e56a87c129a4625.tar.gz sharkey-ab16fb3a3fff96a4fa2bc1fc0e56a87c129a4625.tar.bz2 sharkey-ab16fb3a3fff96a4fa2bc1fc0e56a87c129a4625.zip | |
#1634
Diffstat (limited to 'src/server/api/endpoints/notifications/get_unread_count.ts')
| -rw-r--r-- | src/server/api/endpoints/notifications/get_unread_count.ts | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/server/api/endpoints/notifications/get_unread_count.ts b/src/server/api/endpoints/notifications/get_unread_count.ts deleted file mode 100644 index 9766366ff1..0000000000 --- a/src/server/api/endpoints/notifications/get_unread_count.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Module dependencies - */ -import Notification from '../../../../models/notification'; -import Mute from '../../../../models/mute'; - -/** - * Get count of unread notifications - */ -module.exports = (params, user) => new Promise(async (res, rej) => { - const mute = await Mute.find({ - muterId: user._id - }); - const mutedUserIds = mute.map(m => m.muteeId); - - const count = await Notification - .count({ - notifieeId: user._id, - notifierId: { - $nin: mutedUserIds - }, - isRead: false - }); - - res({ - count: count - }); -}); |