This commit is contained in:
parent
9cb756544e
commit
33ef9bdf61
|
@ -43,6 +43,11 @@ module.exports = Self => {
|
||||||
}
|
}
|
||||||
}, myOptions);
|
}, myOptions);
|
||||||
|
|
||||||
|
const activeNotifications = await models.NotificationSubscription.find({
|
||||||
|
include: {relation: 'notification'},
|
||||||
|
where: {userFk: id}
|
||||||
|
}, myOptions);
|
||||||
|
|
||||||
for (acl of availableNotifications) {
|
for (acl of availableNotifications) {
|
||||||
notifications.set(acl.notificationFk, {
|
notifications.set(acl.notificationFk, {
|
||||||
id: null,
|
id: null,
|
||||||
|
@ -53,17 +58,14 @@ module.exports = Self => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const activeNotifications = await models.NotificationSubscription.find({
|
|
||||||
include: {relation: 'notification'},
|
|
||||||
where: {userFk: id}
|
|
||||||
}, myOptions);
|
|
||||||
|
|
||||||
for (subscription of activeNotifications) {
|
for (subscription of activeNotifications) {
|
||||||
const notification = notifications.get(subscription.notificationFk);
|
notifications.set(subscription.notificationFk, {
|
||||||
if (notification) {
|
id: subscription.id,
|
||||||
notification.active = true;
|
notificationFk: subscription.notificationFk,
|
||||||
notification.id = subscription.id;
|
name: subscription.notification().name,
|
||||||
}
|
description: subscription.notification().description,
|
||||||
|
active: true,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return [...notifications.values()];
|
return [...notifications.values()];
|
||||||
|
|
Loading…
Reference in New Issue