From ab16fb3a3fff96a4fa2bc1fc0e56a87c129a4625 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 29 May 2018 01:22:39 +0900 Subject: #1634 --- .../endpoints/notifications/get_unread_count.ts | 28 ---------------------- 1 file changed, 28 deletions(-) delete mode 100644 src/server/api/endpoints/notifications/get_unread_count.ts (limited to 'src/server/api/endpoints/notifications/get_unread_count.ts') 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 - }); -}); -- cgit v1.2.3-freya