Refactored to use loadAccounts
This commit is contained in:
parent
93b6c0e086
commit
fcfe16d5eb
1 changed files with 2 additions and 11 deletions
|
|
@ -54,17 +54,8 @@ function loadAccounts (schemaVersion) {
|
|||
}
|
||||
|
||||
function showAccounts (schemaVersion) {
|
||||
const sql = `select data
|
||||
from user_config
|
||||
where type=$1
|
||||
and schema_version=$2
|
||||
and valid
|
||||
order by id desc
|
||||
limit 1`
|
||||
|
||||
return db.oneOrNone(sql, ['accounts', schemaVersion || NEW_SETTINGS_LOADER_SCHEMA_VERSION])
|
||||
.then(res => {
|
||||
const accounts = _.compose(_.defaultTo({}), _.get('data.accounts'))(res)
|
||||
return loadAccounts(schemaVersion)
|
||||
.then(accounts => {
|
||||
const filledSecretPaths = _.compact(_.map(path => {
|
||||
if (!_.isEmpty(_.get(path, accounts))) {
|
||||
return path
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue