Fixed redirects.json file validation

refs #10790

- Reference to method previously used to validate wasn't updated during refactoring done in be27db46eb
This commit is contained in:
Nazar Gargol 2019-06-24 10:56:30 +02:00
parent 8ae5db9922
commit 22f56c95a8
2 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,9 @@
module.exports = {
get settings() {
return require('./settings');
},
get validation() {
return require('./validation');
}
};

View File

@ -5,7 +5,7 @@ const path = require('path');
const debug = require('ghost-ignition').debug('web:shared:mw:custom-redirects');
const config = require('../../../config');
const common = require('../../../lib/common');
const validation = require('../../../data/validation');
const redirectsService = require('../../../../frontend/services/redirects');
const _private = {};
@ -19,7 +19,7 @@ _private.registerRoutes = () => {
try {
let redirects = fs.readFileSync(path.join(config.getContentPath('data'), 'redirects.json'), 'utf-8');
redirects = JSON.parse(redirects);
validation.validateRedirects(redirects);
redirectsService.validation.validate(redirects);
redirects.forEach((redirect) => {
/**