From 32fe3d7e7954f6867cc2602a5937bc6de75d6ec5 Mon Sep 17 00:00:00 2001 From: david Date: Thu, 7 Nov 2019 18:45:50 +0100 Subject: [PATCH] . --- modules/notification/notification.controller.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/notification/notification.controller.js b/modules/notification/notification.controller.js index 3e8cc45..bb36fe8 100644 --- a/modules/notification/notification.controller.js +++ b/modules/notification/notification.controller.js @@ -138,6 +138,7 @@ const extraControllers = { return new Promise(function (resolve) { let _userDevices = []; userDevices.forEach(async function (userDevice) { + console.log(userDevice); if (!userDeviceService.isValidPushToken(userDevice.token)) { await disableUserDevicePromise(userDevice.token); } else { @@ -236,9 +237,7 @@ const extraControllers = { getUserIds() ]) .then(function(result) { - let notification = result[0]; - notificationRecord.id = notification.id; - + notificationRecord = result[0]; userIds = result[1]; userIds.forEach(function (userId) { @@ -249,7 +248,7 @@ const extraControllers = { return Promise.all(getUserDevicesList) }).then(function (userDeviceList) { console.log(userDeviceList); - return new Promise(function(resolve) { resolve(userDeviceList[0]); }); + return new Promise(function(resolve) { resolve(userDeviceList); }); }) .then(disableInvalidUserDevicesPromise) .then(buildMessagesPromise)