chore: undo $ prepend on queries
This commit is contained in:
parent
f3f2bb01b0
commit
ba4117173e
50 changed files with 215 additions and 227 deletions
|
|
@ -18,7 +18,7 @@ function loadSchemas () {
|
|||
const schemas = loadSchemas()
|
||||
|
||||
function fetchAccounts () {
|
||||
return db.$oneOrNone('select data from user_config where type=$1 and schema_version=$2', ['accounts', configValidate.SETTINGS_LOADER_SCHEMA_VERSION])
|
||||
return db.oneOrNone('select data from user_config where type=$1 and schema_version=$2', ['accounts', configValidate.SETTINGS_LOADER_SCHEMA_VERSION])
|
||||
.then(row => {
|
||||
// Hard code this for now
|
||||
const accounts = [{
|
||||
|
|
@ -31,7 +31,7 @@ function fetchAccounts () {
|
|||
|
||||
return row
|
||||
? Promise.resolve(row.data.accounts)
|
||||
: db.$none('insert into user_config (type, data, valid) values ($1, $2, $3)', ['accounts', {accounts}, true])
|
||||
: db.none('insert into user_config (type, data, valid) values ($1, $2, $3)', ['accounts', {accounts}, true])
|
||||
.then(fetchAccounts)
|
||||
})
|
||||
}
|
||||
|
|
@ -102,7 +102,7 @@ function getAccount (accountCode) {
|
|||
}
|
||||
|
||||
function save (accounts) {
|
||||
return db.$none('update user_config set data=$1 where type=$2 and schema_version=$3', [{accounts: accounts}, 'accounts', configValidate.SETTINGS_LOADER_SCHEMA_VERSION])
|
||||
return db.none('update user_config set data=$1 where type=$2 and schema_version=$3', [{accounts: accounts}, 'accounts', configValidate.SETTINGS_LOADER_SCHEMA_VERSION])
|
||||
}
|
||||
|
||||
function updateAccounts (newAccount, accounts) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue