mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Add extra notification debugging
This commit is contained in:
parent
a3501a76ff
commit
8439b2e0ef
1 changed files with 7 additions and 0 deletions
|
|
@ -39,11 +39,17 @@ export function notificationRouter() {
|
|||
} = req.body as Notification
|
||||
|
||||
if (!userId || !body) {
|
||||
console.log(
|
||||
' -- send notification failed no user id or body',
|
||||
userId,
|
||||
body
|
||||
)
|
||||
return res.status(400).send({ errorCode: 'BAD_DATA' })
|
||||
}
|
||||
|
||||
const tokens = await getDeviceTokensByUserId(userId)
|
||||
if (tokens.length === 0) {
|
||||
console.log(' -- send notification failed no device tokens')
|
||||
return res.status(400).send({ errorCode: 'NO_DEVICE_TOKENS' })
|
||||
}
|
||||
|
||||
|
|
@ -63,6 +69,7 @@ export function notificationRouter() {
|
|||
notificationType || 'rule'
|
||||
)
|
||||
if (!result) {
|
||||
console.log(' -- send notification failed for message: ', message)
|
||||
return res.status(400).send({ errorCode: 'SEND_NOTIFICATION_FAILED' })
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue