mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-03 08:25:06 +03:00
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:
parent
748ea9540c
commit
58ba14c188
@ -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);
|
||||
|
@ -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));
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
},
|
||||
|
@ -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);
|
||||
}
|
||||
},
|
||||
|
@ -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);
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user