diff --git a/back/models/notificationSubscription.js b/back/models/notificationSubscription.js index 77ef8ffbe..eafa9d51b 100644 --- a/back/models/notificationSubscription.js +++ b/back/models/notificationSubscription.js @@ -5,7 +5,7 @@ module.exports = Self => { const models = Self.app.models; const userId = ctx.options.accessToken.userId; const user = await ctx.instance.userFk; - const modifiedUser = await getUserToModify(user, models); + const modifiedUser = await getUserToModify(null, user, models); if (userId == modifiedUser.id || userId == modifiedUser.bossFk) return; @@ -40,7 +40,7 @@ module.exports = Self => { Self.deleteNotification = async function(ctx, notificationId) { const models = Self.app.models; const user = ctx.req.accessToken.userId; - const modifiedUser = await getUserToModify(notificationId, models); + const modifiedUser = await getUserToModify(notificationId, null, models); if (user == modifiedUser.id || modifiedUser.bossFk == user) { await models.NotificationSubscription.destroyById(notificationId);