.
This commit is contained in:
parent
426ddffa5f
commit
5e885ff3b4
@ -97,6 +97,7 @@ const extraControllers = {
|
|||||||
to: userDevice.token,
|
to: userDevice.token,
|
||||||
sound: 'default',
|
sound: 'default',
|
||||||
notificationId: notificationRecord.id,
|
notificationId: notificationRecord.id,
|
||||||
|
data: notificationRecord.data,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -187,15 +188,15 @@ const extraControllers = {
|
|||||||
|
|
||||||
// Buscamos el token y el usuario
|
// Buscamos el token y el usuario
|
||||||
console.log('>> Busco el usuario y el token', params.params);
|
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) {
|
if (!result) {
|
||||||
// Dar de alta el token
|
// Dar de alta el token
|
||||||
console.log('>> Dar de alta el token', data);
|
console.log('>> Dar de alta el token', data);
|
||||||
result = await notificationService.create(data, context);
|
result = await userDeviceService.create(data, context);
|
||||||
} else {
|
} else {
|
||||||
// Actualizar el token
|
// Actualizar el token
|
||||||
console.log('>> Actualizar el token', params.params, data, context);
|
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) {
|
} catch(error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user