From d362d8c8bd36b731b12d29926cde964059e59ebb Mon Sep 17 00:00:00 2001 From: PJ <43812132+pegjee@users.noreply.github.com> Date: Wed, 13 Oct 2021 19:07:57 +1100 Subject: [PATCH] Replace i18n with tpl in core/server/api/v3/invites.js (#13587) refs: #13380 - The i18n package is deprecated. It is being replaced with the tpl package. --- core/server/api/v3/invites.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/server/api/v3/invites.js b/core/server/api/v3/invites.js index 89ca793846..25edd787fd 100644 --- a/core/server/api/v3/invites.js +++ b/core/server/api/v3/invites.js @@ -1,11 +1,14 @@ const Promise = require('bluebird'); -const i18n = require('../../../shared/i18n'); +const tpl = require('@tryghost/tpl'); const errors = require('@tryghost/errors'); const invites = require('../../services/invites'); const models = require('../../models'); const api = require('./index'); const ALLOWED_INCLUDES = []; const UNSAFE_ATTRS = ['role_id']; +const messages = { + inviteNotFound: 'Invite not found.' +}; module.exports = { docName: 'invites', @@ -50,7 +53,7 @@ module.exports = { .then((model) => { if (!model) { return Promise.reject(new errors.NotFoundError({ - message: i18n.t('errors.api.invites.inviteNotFound') + message: tpl(messages.inviteNotFound) })); } @@ -78,7 +81,7 @@ module.exports = { .then(() => null) .catch(models.Invite.NotFoundError, () => { return Promise.reject(new errors.NotFoundError({ - message: i18n.t('errors.api.invites.inviteNotFound') + message: tpl(messages.inviteNotFound) })); }); }