refactor: move fetchCurrentConfigVersion() to settings loader
This commit is contained in:
parent
d3d4042d97
commit
bb440eedd6
4 changed files with 20 additions and 24 deletions
|
|
@ -228,6 +228,15 @@ function load (versionId) {
|
|||
}))
|
||||
}
|
||||
|
||||
const fetchCurrentConfigVersion = () => {
|
||||
const sql = `SELECT id FROM user_config
|
||||
WHERE type = 'config'
|
||||
AND valid
|
||||
ORDER BY id DESC
|
||||
LIMIT 1`
|
||||
return db.one(sql).then(row => row.id)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
saveConfig,
|
||||
migrationSaveConfig,
|
||||
|
|
@ -238,5 +247,6 @@ module.exports = {
|
|||
loadLatestConfig,
|
||||
loadLatestConfigOrNone,
|
||||
load,
|
||||
removeFromConfig
|
||||
removeFromConfig,
|
||||
fetchCurrentConfigVersion,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue