From 5ada49295617320d88a6d9457f504b5d80cd2ee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Salgado?= Date: Tue, 22 Jun 2021 19:58:47 +0100 Subject: [PATCH] fix: remove spread operator usage --- lib/notifier/index.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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) })