chore: integrate new admin with l-s
This commit is contained in:
parent
6b3db134e7
commit
bf8f1d991c
72 changed files with 1493 additions and 1611 deletions
|
|
@ -4,7 +4,6 @@ const db = require('./db')
|
|||
const dbm = require('./postgresql_interface')
|
||||
const T = require('./time')
|
||||
const BN = require('./bn')
|
||||
const settingsLoader = require('./settings-loader')
|
||||
|
||||
const TRANSACTION_EXPIRATION = T.day
|
||||
|
||||
|
|
@ -90,33 +89,9 @@ function updateDeviceConfigVersion (versionId) {
|
|||
return db.none('update devices set user_config_id=$1', [versionId])
|
||||
}
|
||||
|
||||
function updateMachineDefaults (deviceId) {
|
||||
const newFields = [{
|
||||
fieldLocator: {
|
||||
fieldScope: {
|
||||
crypto: 'global',
|
||||
machine: deviceId
|
||||
},
|
||||
code: 'cashOutEnabled',
|
||||
fieldType: 'onOff',
|
||||
fieldClass: null
|
||||
},
|
||||
fieldValue: {
|
||||
fieldType: 'onOff',
|
||||
value: false
|
||||
}
|
||||
}]
|
||||
|
||||
return settingsLoader.loadLatest()
|
||||
.then(settings => {
|
||||
return settingsLoader.save(settingsLoader.mergeValues(settings.config, newFields))
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
stateChange,
|
||||
fetchPhoneTx,
|
||||
fetchStatusTx,
|
||||
updateDeviceConfigVersion,
|
||||
updateMachineDefaults
|
||||
updateDeviceConfigVersion
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue