Chore: move catch into queries file
This commit is contained in:
parent
05373e83db
commit
82912b728a
7 changed files with 26 additions and 28 deletions
|
|
@ -343,7 +343,7 @@ function triggerBlock (req, res, next) {
|
|||
|
||||
customers.update(id, { authorizedOverride: 'blocked' })
|
||||
.then(customer => {
|
||||
notifier.notifyIfActive('compliance', 'customerComplianceNotify', customer, req.deviceId, 'BLOCKED').catch(console.error)
|
||||
notifier.notifyIfActive('compliance', 'customerComplianceNotify', customer, req.deviceId, 'BLOCKED')
|
||||
return respond(req, res, { customer })
|
||||
})
|
||||
.catch(next)
|
||||
|
|
@ -362,7 +362,7 @@ function triggerSuspend (req, res, next) {
|
|||
date.setDate(date.getDate() + days);
|
||||
customers.update(id, { suspendedUntil: date })
|
||||
.then(customer => {
|
||||
notifier.notifyIfActive('compliance', 'customerComplianceNotify', customer, req.deviceId, 'SUSPENDED', days).catch(console.error)
|
||||
notifier.notifyIfActive('compliance', 'customerComplianceNotify', customer, req.deviceId, 'SUSPENDED', days)
|
||||
return respond(req, res, { customer })
|
||||
})
|
||||
.catch(next)
|
||||
|
|
@ -432,7 +432,7 @@ function respond (req, res, _body, _status) {
|
|||
const customer = _.getOr({ sanctions: true }, ['customer'], body)
|
||||
// sanctions can be null for new customers so we can't use falsy checks
|
||||
if (customer.sanctions === false) {
|
||||
notifier.notifyIfActive('compliance', 'sanctionsNotify', customer, req.body.phone).catch(console.error)
|
||||
notifier.notifyIfActive('compliance', 'sanctionsNotify', customer, req.body.phone)
|
||||
}
|
||||
return res.status(status).json(body)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue