fix no-exchange issue
This commit is contained in:
parent
a60a4f8793
commit
f23d17b357
7 changed files with 29 additions and 17 deletions
|
|
@ -98,9 +98,9 @@ function fetchConfigGroup (code) {
|
|||
|
||||
return {
|
||||
schema: groupSchema,
|
||||
values: values,
|
||||
values,
|
||||
selectedCryptos: getCryptos(config, machineList),
|
||||
data: data
|
||||
data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -250,7 +250,7 @@ function postProcess (txVector, pi) {
|
|||
return pi.buildAvailableCassettes(newTx.id)
|
||||
.then(cassettes => {
|
||||
const bills = billMath.makeChange(cassettes.cassettes, newTx.fiat)
|
||||
console.log('DEBUG130: %j', cassettes.cassettes)
|
||||
|
||||
if (!bills) throw httpError('Out of bills', INSUFFICIENT_FUNDS_CODE)
|
||||
return bills
|
||||
})
|
||||
|
|
|
|||
|
|
@ -29,8 +29,6 @@ function getMachineNames (config) {
|
|||
.then(([machines, config]) => {
|
||||
const addName = r => {
|
||||
const name = configManager.machineScoped(r.deviceId, config).machineName
|
||||
console.log('DEBUG200: %j', [name, r])
|
||||
console.log('DEBUG201: %j', configManager.machineScoped(r.deviceId, config))
|
||||
return _.set('name', name, r)
|
||||
}
|
||||
|
||||
|
|
@ -54,5 +52,3 @@ function setMachine (rec) {
|
|||
default: throw new Error('No such action: ' + rec.action)
|
||||
}
|
||||
}
|
||||
|
||||
console.log('DEBUG101')
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@ function pullToken (token) {
|
|||
function configureNewDevice (deviceId, machineName, machineModel) {
|
||||
const scope = {crypto: 'global', machine: deviceId}
|
||||
const newFields = [
|
||||
settingsLoader.configAddField(scope, 'cashOutEnabled', false),
|
||||
settingsLoader.configAddField(scope, 'machineName', machineName),
|
||||
settingsLoader.configAddField(scope, 'machineModel', machineModel)
|
||||
settingsLoader.configAddField(scope, 'cashOutEnabled', 'onOff', null, false),
|
||||
settingsLoader.configAddField(scope, 'machineName', 'string', null, machineName),
|
||||
settingsLoader.configAddField(scope, 'machineModel', 'string', null, machineModel)
|
||||
]
|
||||
|
||||
return settingsLoader.modifyConfig(newFields)
|
||||
|
|
@ -26,7 +26,11 @@ function configureNewDevice (deviceId, machineName, machineModel) {
|
|||
|
||||
function removeDeviceConfig (deviceId) {
|
||||
const scope = {crypto: 'global', machine: deviceId}
|
||||
const newFields = [settingsLoader.configDeleteField(scope, 'cashOutEnabled', false)]
|
||||
const newFields = [
|
||||
settingsLoader.configDeleteField(scope, 'cashOutEnabled'),
|
||||
settingsLoader.configDeleteField(scope, 'machineName'),
|
||||
settingsLoader.configDeleteField(scope, 'machineModel')
|
||||
]
|
||||
|
||||
return settingsLoader.modifyConfig(newFields)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,16 +139,18 @@ function save (config) {
|
|||
.catch(() => db.none(sql, ['config', {config}, false]))
|
||||
}
|
||||
|
||||
function configAddField (scope, fieldCode, value) {
|
||||
function configAddField (scope, fieldCode, fieldType, fieldClass, value) {
|
||||
return {
|
||||
fieldLocator: {
|
||||
fieldScope: {
|
||||
crypto: scope.crypto,
|
||||
machine: scope.machine
|
||||
},
|
||||
code: fieldCode
|
||||
code: fieldCode,
|
||||
fieldType,
|
||||
fieldClass
|
||||
},
|
||||
fieldValue: {value}
|
||||
fieldValue: {fieldType, value}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue