Removed use of 'routes' parameter for getCurrentHash function

refs https://linear.app/tryghost/issue/CORE-35/refactor-route-and-redirect-settings

- With a single possible value for setting ('routes') there's no need to pass the parameter around
This commit is contained in:
Naz 2021-09-23 14:31:58 +02:00 committed by naz
parent 748ea9540c
commit 58ba14c188
5 changed files with 6 additions and 6 deletions

View File

@ -155,7 +155,7 @@ async function initDynamicRouting() {
debug(`Frontend API Version: ${apiVersion}`);
routing.bootstrap.start(apiVersion, routeSettings);
const getRoutesHash = () => frontendSettings.getCurrentHash('routes');
const getRoutesHash = () => frontendSettings.getCurrentHash();
const settings = require('./server/services/settings');
await settings.syncRoutesHash(getRoutesHash);

View File

@ -38,8 +38,8 @@ module.exports = {
return defaultRoutesSettingHash;
},
getCurrentHash: async (setting) => {
const data = await SettingsLoader.loadSettings(setting);
getCurrentHash: async () => {
const data = await SettingsLoader.loadSettings('routes');
return calculateHash(JSON.stringify(data));
}

View File

@ -191,7 +191,7 @@ module.exports = {
},
async query(frame) {
await routeSettings.setFromFilePath(frame.file.path);
const getRoutesHash = () => frontendSettings.getCurrentHash('routes');
const getRoutesHash = () => frontendSettings.getCurrentHash();
await settingsService.syncRoutesHash(getRoutesHash);
}
},

View File

@ -169,7 +169,7 @@ module.exports = {
},
async query(frame) {
await routeSettings.setFromFilePath(frame.file.path);
const getRoutesHash = () => frontendSettings.getCurrentHash('routes');
const getRoutesHash = () => frontendSettings.getCurrentHash();
await settingsService.syncRoutesHash(getRoutesHash);
}
},

View File

@ -195,7 +195,7 @@ module.exports = {
},
async query(frame) {
await routeSettings.setFromFilePath(frame.file.path);
const getRoutesHash = () => frontendSettings.getCurrentHash('routes');
const getRoutesHash = () => frontendSettings.getCurrentHash();
await settingsService.syncRoutesHash(getRoutesHash);
}
},