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

Replaced i18n.t w/ tpl helper in pages.js

refs: #13380
This commit is contained in:
Ania Kowalska 2021-10-06 12:47:26 +02:00 committed by Hannah Wolfe
parent 10a24393d0
commit 1d534bcd65

View file

@ -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)
}));
});
}