feat: add reset settings to user config
This commit is contained in:
parent
1d1f08060f
commit
d1d4910555
1 changed files with 23 additions and 0 deletions
23
migrations/1620680439585-add-cashbox-reset-settings.js
Normal file
23
migrations/1620680439585-add-cashbox-reset-settings.js
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
const { saveConfig, loadLatest } = require('../lib/new-settings-loader')
|
||||||
|
|
||||||
|
exports.up = function (next) {
|
||||||
|
const newConfig = {
|
||||||
|
cashIn_automaticCashboxReset: false
|
||||||
|
}
|
||||||
|
return loadLatest()
|
||||||
|
.then(config => {
|
||||||
|
return saveConfig(newConfig)
|
||||||
|
.then(() => next())
|
||||||
|
.catch(err => {
|
||||||
|
if (err.message === 'lamassu-server is not configured') {
|
||||||
|
return next()
|
||||||
|
}
|
||||||
|
console.log(err.message)
|
||||||
|
return next(err)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports.down = function (next) {
|
||||||
|
next()
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue