fix: compliance notifications through sms and email

This commit is contained in:
Sérgio Salgado 2021-06-10 19:22:51 +01:00 committed by Josh Harvey
parent 6537938ec3
commit 129e5555df
2 changed files with 48 additions and 2 deletions

View file

@ -61,7 +61,7 @@ function triggerBlock (req, res, next) {
customers.update(id, { authorizedOverride: 'blocked' })
.then(customer => {
notifier.notifyIfActive('compliance', 'customerComplianceNotify', customer, req.deviceId, 'BLOCKED')
notifier.complianceNotify(customer, req.deviceId, 'BLOCKED')
return respond(req, res, { customer })
})
.catch(next)
@ -80,7 +80,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)
notifier.complianceNotify(customer, req.deviceId, 'SUSPENDED', days)
return respond(req, res, { customer })
})
.catch(next)