add cashOut attribute to machines API

This commit is contained in:
Josh Harvey 2017-05-16 15:10:47 +03:00
parent db97533d5c
commit 87a4236313
3 changed files with 109 additions and 116 deletions

View file

@ -28,8 +28,11 @@ function getMachineNames (config) {
return Promise.all([getMachines(), getConfig(config)])
.then(([machines, config]) => {
const addName = r => {
const name = configManager.machineScoped(r.deviceId, config).machineName
return _.set('name', name, r)
const machineScoped = configManager.machineScoped(r.deviceId, config)
const name = machineScoped.machineName
const cashOut = machineScoped.cashOutEnabled
return _.assign(r, {name, cashOut})
}
return _.map(addName, machines)