Feat: move notif center fns to own file on the notifier module

Fix: fix jest test
This commit is contained in:
Cesar 2021-01-20 14:37:34 +00:00 committed by Josh Harvey
parent 34f2b84fe2
commit 69d3e4cb9b
6 changed files with 204 additions and 190 deletions

View file

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