mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
parent
10a24393d0
commit
1d534bcd65
1 changed files with 7 additions and 3 deletions
|
@ -1,10 +1,14 @@
|
|||
const models = require('../../models');
|
||||
const i18n = require('../../../shared/i18n');
|
||||
const tpl = require('@tryghost/tpl');
|
||||
const errors = require('@tryghost/errors');
|
||||
const getPostServiceInstance = require('../../services/posts/posts-service');
|
||||
const ALLOWED_INCLUDES = ['tags', 'authors', 'authors.roles'];
|
||||
const UNSAFE_ATTRS = ['status', 'authors', 'visibility'];
|
||||
|
||||
const messages = {
|
||||
pageNotFound: 'Page not found.'
|
||||
};
|
||||
|
||||
const postsService = getPostServiceInstance('canary');
|
||||
|
||||
module.exports = {
|
||||
|
@ -75,7 +79,7 @@ module.exports = {
|
|||
.then((model) => {
|
||||
if (!model) {
|
||||
throw new errors.NotFoundError({
|
||||
message: i18n.t('errors.api.pages.pageNotFound')
|
||||
message: tpl(messages.pageNotFound)
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -188,7 +192,7 @@ module.exports = {
|
|||
.then(() => null)
|
||||
.catch(models.Post.NotFoundError, () => {
|
||||
return Promise.reject(new errors.NotFoundError({
|
||||
message: i18n.t('errors.api.pages.pageNotFound')
|
||||
message: tpl(messages.pageNotFound)
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue