mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Fixed 404 error when email only posts have been enabled
refs https://github.com/TryGhost/Team/issues/990 refs https://linear.app/tryghost/issue/CORE-25 - It used to be required remembering to restart the ghost process/routing after switching the email-only flag for the change to take effect. It was often forgotten and caused confusion.
This commit is contained in:
parent
3eb41d3e36
commit
74f00bae1e
1 changed files with 3 additions and 2 deletions
|
@ -3,6 +3,7 @@ const config = require('../../../../shared/config');
|
||||||
const urlService = require('../../url');
|
const urlService = require('../../url');
|
||||||
const urlUtils = require('../../../../shared/url-utils');
|
const urlUtils = require('../../../../shared/url-utils');
|
||||||
const helpers = require('../helpers');
|
const helpers = require('../helpers');
|
||||||
|
const labs = require('../../../../shared/labs');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Email Post Controller.
|
* @description Email Post Controller.
|
||||||
|
@ -11,7 +12,7 @@ const helpers = require('../helpers');
|
||||||
* @param {Function} next
|
* @param {Function} next
|
||||||
* @returns {Promise}
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
module.exports = function emailPostController(req, res, next) {
|
module.exports = [labs.enabledMiddleware('emailOnlyPosts'), function emailPostController(req, res, next) {
|
||||||
debug('emailPostController');
|
debug('emailPostController');
|
||||||
|
|
||||||
const api = require('../../proxy').api[res.locals.apiVersion];
|
const api = require('../../proxy').api[res.locals.apiVersion];
|
||||||
|
@ -62,4 +63,4 @@ module.exports = function emailPostController(req, res, next) {
|
||||||
return renderer(post);
|
return renderer(post);
|
||||||
})
|
})
|
||||||
.catch(helpers.handleError(next));
|
.catch(helpers.handleError(next));
|
||||||
};
|
}];
|
||||||
|
|
Loading…
Add table
Reference in a new issue