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);