0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Refactored routes hash to be a "single" value

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

- It's a continuation of simplifying the concept of multiple frontend settings. If there's just one file we support there should be just one hash
This commit is contained in:
Naz 2021-09-23 14:27:58 +02:00 committed by naz
parent 93af11bdec
commit 748ea9540c
2 changed files with 5 additions and 7 deletions

View file

@ -4,11 +4,9 @@ const SettingsLoader = require('./loader');
const ensureSettingsFile = require('./ensure-settings');
/**
* md5 hashes of default settings
* md5 hashes of default routes settings
*/
const defaultHashes = {
routes: '3d180d52c663d173a6be791ef411ed01'
};
const defaultRoutesSettingHash = '3d180d52c663d173a6be791ef411ed01';
const calculateHash = (data) => {
return crypto.createHash('md5')
@ -36,8 +34,8 @@ module.exports = {
return SettingsLoader('routes');
},
getDefaulHash: (setting) => {
return defaultHashes[setting];
getDefaultHash: () => {
return defaultRoutesSettingHash;
},
getCurrentHash: async (setting) => {

View file

@ -64,6 +64,6 @@ describe('DB version integrity', function () {
fixturesHash.should.eql(currentFixturesHash);
settingsHash.should.eql(currentSettingsHash);
routesHash.should.eql(currentRoutesHash);
routesHash.should.eql(frontendSettings.getDefaulHash('routes'));
routesHash.should.eql(frontendSettings.getDefaultHash());
});
});