This commit is contained in:
syuilo
2018-03-28 16:39:14 +09:00
parent 7d4d9dbaa6
commit 3d5cdb8d2d
237 changed files with 1661 additions and 1354 deletions

View File

@@ -13,18 +13,18 @@ import Mute from '../../models/mute';
*/
module.exports = (params, user) => new Promise(async (res, rej) => {
const mute = await Mute.find({
muter_id: user._id,
deleted_at: { $exists: false }
muterId: user._id,
deletedAt: { $exists: false }
});
const mutedUserIds = mute.map(m => m.mutee_id);
const mutedUserIds = mute.map(m => m.muteeId);
const count = await Notification
.count({
notifiee_id: user._id,
notifier_id: {
notifieeId: user._id,
notifierId: {
$nin: mutedUserIds
},
is_read: false
isRead: false
});
res({