0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Replaced i18n w/ tpl in /core/server/api/v3/posts-public.js (#13527)

refs: #13380

- The i18n package is deprecated. It is being replaced with the tpl package.
This commit is contained in:
Ayoub BERDEDDOUCH 2021-10-11 15:40:01 +02:00 committed by GitHub
parent 8102a316d5
commit 1249254a68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,8 +1,10 @@
const models = require('../../models');
const i18n = require('../../../shared/i18n');
const tpl = require('@tryghost/tpl');
const errors = require('@tryghost/errors');
const allowedIncludes = ['tags', 'authors'];
const messages = {
postNotFound: 'Post not found.'
};
module.exports = {
docName: 'posts',
@ -63,7 +65,7 @@ module.exports = {
.then((model) => {
if (!model) {
throw new errors.NotFoundError({
message: i18n.t('errors.api.posts.postNotFound')
message: tpl(messages.postNotFound)
});
}