chore: remove dead code

This commit is contained in:
siiky 2024-09-12 17:07:31 +01:00
parent 446ac9f8db
commit 19c7d73444
6 changed files with 1 additions and 117 deletions

View file

@ -474,8 +474,4 @@ function migrate (config, accounts) {
}
}
module.exports = {
migrateConfig,
migrateAccounts,
migrate
}
module.exports = { migrate }

View file

@ -7,10 +7,7 @@ const resolvers = {
},
Mutation: {
saveAccounts: (...[, { accounts }]) => settingsLoader.saveAccounts(accounts),
// resetAccounts: (...[, { schemaVersion }]) => settingsLoader.resetAccounts(schemaVersion),
saveConfig: (...[, { config }]) => settingsLoader.saveConfig(config),
// resetConfig: (...[, { schemaVersion }]) => settingsLoader.resetConfig(schemaVersion),
// migrateConfigAndAccounts: () => settingsLoader.migrate()
}
}

View file

@ -8,10 +8,7 @@ const typeDef = gql`
type Mutation {
saveAccounts(accounts: JSONObject): JSONObject @auth
# resetAccounts(schemaVersion: Int): JSONObject @auth
saveConfig(config: JSONObject): JSONObject @auth
# resetConfig(schemaVersion: Int): JSONObject @auth
# migrateConfigAndAccounts: JSONObject @auth
}
`

View file

@ -80,17 +80,6 @@ function saveAccounts (accounts) {
}).catch(console.error)
})
}
function resetAccounts (schemaVersion) {
return db.none(
accountsSql,
[
'accounts',
{ accounts: NEW_SETTINGS_LOADER_SCHEMA_VERSION ? {} : [] },
true,
schemaVersion
]
)
}
function loadAccounts (schemaVersion) {
const sql = `SELECT data
@ -149,18 +138,6 @@ function migrationSaveConfig (config) {
})
}
function resetConfig (schemaVersion) {
return db.none(
configSql,
[
'config',
{ config: schemaVersion === NEW_SETTINGS_LOADER_SCHEMA_VERSION ? {} : [] },
true,
schemaVersion
]
)
}
function loadLatest (schemaVersion) {
return Promise.all([loadLatestConfigOrNoneReturningVersion(schemaVersion), loadAccounts(schemaVersion)])
.then(([configObj, accounts]) => ({