From 5e885ff3b43bbc164788d490040a20e5a67fdd84 Mon Sep 17 00:00:00 2001 From: david Date: Tue, 22 Oct 2019 12:15:19 +0200 Subject: [PATCH] . --- modules/notification/notification.controller.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/notification/notification.controller.js b/modules/notification/notification.controller.js index b676aaf..839ac63 100644 --- a/modules/notification/notification.controller.js +++ b/modules/notification/notification.controller.js @@ -97,6 +97,7 @@ const extraControllers = { to: userDevice.token, sound: 'default', notificationId: notificationRecord.id, + data: notificationRecord.data, }); }); @@ -187,15 +188,15 @@ const extraControllers = { // Buscamos el token y el usuario console.log('>> Busco el usuario y el token', params.params); - let result = await notificationService.fetchOne(params, context); + let result = await userDeviceService.fetchOne(params, context); if (!result) { // Dar de alta el token console.log('>> Dar de alta el token', data); - result = await notificationService.create(data, context); + result = await userDeviceService.create(data, context); } else { // Actualizar el token console.log('>> Actualizar el token', params.params, data, context); - result = await notificationService.update(params.params, data, context); + result = await userDeviceService.update(params.params, data, context); } } catch(error) { console.error(error);