Catch error from sending notification api
This commit is contained in:
@ -24,7 +24,6 @@
|
||||
"@sentry/serverless": "^6.16.1",
|
||||
"axios": "^0.27.2",
|
||||
"dotenv": "^16.0.1",
|
||||
"firebase-admin": "^10.0.2",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"search-query-parser": "^1.6.0"
|
||||
}
|
||||
|
||||
@ -26,10 +26,14 @@ export const sendNotification = async (
|
||||
notificationType: 'rule',
|
||||
}
|
||||
|
||||
await axios.post(`${apiEndpoint}/notification/send`, data, {
|
||||
headers: {
|
||||
Cookie: `auth=${auth};`,
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
})
|
||||
try {
|
||||
await axios.post(`${apiEndpoint}/notification/send`, data, {
|
||||
headers: {
|
||||
Cookie: `auth=${auth};`,
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
})
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user