This commit is contained in:
parent
e7d16dc8ba
commit
5171e63188
|
@ -50,7 +50,7 @@ module.exports = Self => {
|
|||
}
|
||||
}, myOptions);
|
||||
|
||||
activeNotifications.forEach(subscription => {
|
||||
for (subscription of activeNotifications) {
|
||||
notifications.push({
|
||||
id: subscription.id,
|
||||
notificationFk: subscription.notificationFk,
|
||||
|
@ -58,9 +58,9 @@ module.exports = Self => {
|
|||
description: subscription.notification().description,
|
||||
active: true
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
availableNotifications.forEach(acl => {
|
||||
for (acl of availableNotifications) {
|
||||
const activeNotif = notifications.find(
|
||||
notif => notif.notificationFk === acl.notificationFk
|
||||
);
|
||||
|
@ -73,7 +73,7 @@ module.exports = Self => {
|
|||
active: false,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return notifications;
|
||||
};
|
||||
|
|
|
@ -28,11 +28,4 @@ describe('NotificationSubscription getList()', () => {
|
|||
expect(result.filter(notification => notification.active == false).length)
|
||||
.toEqual(availableNotifications.length - activeNotifications.length);
|
||||
});
|
||||
|
||||
it('should return empty from a non existent user', async() => {
|
||||
const userId = 123456789;
|
||||
const result = await models.NotificationSubscription.getList(userId);
|
||||
|
||||
expect(result.length).toEqual(0);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue