Resolve conflicts
This commit is contained in:
@ -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({
|
||||
|
@ -14,11 +14,11 @@ import event from '../../event';
|
||||
module.exports = (params, user) => new Promise(async (res, rej) => {
|
||||
// Update documents
|
||||
await Notification.update({
|
||||
notifiee_id: user._id,
|
||||
is_read: false
|
||||
notifieeId: user._id,
|
||||
isRead: false
|
||||
}, {
|
||||
$set: {
|
||||
is_read: true
|
||||
isRead: true
|
||||
}
|
||||
}, {
|
||||
multi: true
|
||||
|
Reference in New Issue
Block a user