diff --git a/lib/notifier/index.js b/lib/notifier/index.js index 4405a5ea..d2c33203 100644 --- a/lib/notifier/index.js +++ b/lib/notifier/index.js @@ -166,7 +166,7 @@ function transactionNotify (tx, rec) { }) } -function complianceNotify (customer, deviceId, ...args) { +function complianceNotify (customer, deviceId, action, period) { return Promise.all([ settingsLoader.loadLatest(), queries.getMachineName(deviceId) @@ -174,8 +174,6 @@ function complianceNotify (customer, deviceId, ...args) { .then(([settings, machineName]) => { const notifications = configManager.getGlobalNotifications(settings.config) - const [action, period] = args - const msgCore = { BLOCKED: `was blocked`, SUSPENDED: `was suspended for ${!!period && period} days` @@ -204,7 +202,7 @@ function complianceNotify (customer, deviceId, ...args) { if (emailActive) promises.push(emailFuncs.sendMessage(settings, rec)) if (smsActive) promises.push(smsFuncs.sendMessage(settings, rec)) - notifyIfActive('compliance', 'customerComplianceNotify', customer, deviceId, ...args) + notifyIfActive('compliance', 'customerComplianceNotify', customer, deviceId, action, period) return Promise.all(promises) })