fix: remove spread operator usage
This commit is contained in:
parent
ad3cb04549
commit
5ada492956
1 changed files with 2 additions and 4 deletions
|
|
@ -166,7 +166,7 @@ function transactionNotify (tx, rec) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function complianceNotify (customer, deviceId, ...args) {
|
function complianceNotify (customer, deviceId, action, period) {
|
||||||
return Promise.all([
|
return Promise.all([
|
||||||
settingsLoader.loadLatest(),
|
settingsLoader.loadLatest(),
|
||||||
queries.getMachineName(deviceId)
|
queries.getMachineName(deviceId)
|
||||||
|
|
@ -174,8 +174,6 @@ function complianceNotify (customer, deviceId, ...args) {
|
||||||
.then(([settings, machineName]) => {
|
.then(([settings, machineName]) => {
|
||||||
const notifications = configManager.getGlobalNotifications(settings.config)
|
const notifications = configManager.getGlobalNotifications(settings.config)
|
||||||
|
|
||||||
const [action, period] = args
|
|
||||||
|
|
||||||
const msgCore = {
|
const msgCore = {
|
||||||
BLOCKED: `was blocked`,
|
BLOCKED: `was blocked`,
|
||||||
SUSPENDED: `was suspended for ${!!period && period} days`
|
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 (emailActive) promises.push(emailFuncs.sendMessage(settings, rec))
|
||||||
if (smsActive) promises.push(smsFuncs.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)
|
return Promise.all(promises)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue