load latest *good* config
This commit is contained in:
parent
dd7d06f38b
commit
5f0b70ca42
4 changed files with 31 additions and 13 deletions
|
|
@ -6,6 +6,7 @@ const R = require('ramda')
|
|||
const currencies = require('../../currencies.json')
|
||||
const languageRec = require('../../languages.json')
|
||||
const countries = require('../../countries.json')
|
||||
const settingsLoader = require('../settings-loader')
|
||||
|
||||
const db = require('../db')
|
||||
const options = require('../options')
|
||||
|
|
@ -254,11 +255,6 @@ function fetchData () {
|
|||
}))
|
||||
}
|
||||
|
||||
function dbSaveConfig (config) {
|
||||
const sql = 'insert into user_config (type, data) values ($1, $2)'
|
||||
return db.none(sql, ['config', {config}])
|
||||
}
|
||||
|
||||
function saveConfigGroup (results) {
|
||||
if (results.values.length === 0) return fetchConfigGroup(results.groupCode)
|
||||
|
||||
|
|
@ -289,7 +285,7 @@ function saveConfigGroup (results) {
|
|||
if (!R.isNil(newValue.fieldValue)) oldValues.push(newValue)
|
||||
})
|
||||
|
||||
return dbSaveConfig(oldValues)
|
||||
return settingsLoader.save(oldValues)
|
||||
.then(() => fetchConfigGroup(results.groupCode))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue