add more db fields for fixed fee

This commit is contained in:
Josh Harvey 2017-05-19 01:34:09 +03:00
parent 8ecc8ce510
commit 8cdad0bc15
10 changed files with 74 additions and 65 deletions

View file

@ -131,9 +131,12 @@ function settings () {
return settingsCache
}
const pp = require('./pp')
function save (config) {
const sql = 'insert into user_config (type, data, valid) values ($1, $2, $3)'
console.log(pp('DEBUG101')(config))
return configValidate.validate(config)
.then(() => db.none(sql, ['config', {config}, true]))
.catch(() => db.none(sql, ['config', {config}, false]))