mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Replaced i18n.t w/ tpl in v2/invites.js (#13498)
refs: TryGhost#13380 - The i18n package is deprecated. It is being replaced with the tpl package.
This commit is contained in:
parent
4b742adafc
commit
e1bcd422f5
1 changed files with 7 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
const Promise = require('bluebird');
|
const Promise = require('bluebird');
|
||||||
const i18n = require('../../../shared/i18n');
|
const tpl = require('@tryghost/tpl');
|
||||||
const errors = require('@tryghost/errors');
|
const errors = require('@tryghost/errors');
|
||||||
const invites = require('../../services/invites');
|
const invites = require('../../services/invites');
|
||||||
const models = require('../../models');
|
const models = require('../../models');
|
||||||
|
@ -7,6 +7,10 @@ const api = require('./index');
|
||||||
const ALLOWED_INCLUDES = [];
|
const ALLOWED_INCLUDES = [];
|
||||||
const UNSAFE_ATTRS = ['role_id'];
|
const UNSAFE_ATTRS = ['role_id'];
|
||||||
|
|
||||||
|
const messages = {
|
||||||
|
inviteNotFound: 'Invite not found.'
|
||||||
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
docName: 'invites',
|
docName: 'invites',
|
||||||
|
|
||||||
|
@ -50,7 +54,7 @@ module.exports = {
|
||||||
.then((model) => {
|
.then((model) => {
|
||||||
if (!model) {
|
if (!model) {
|
||||||
return Promise.reject(new errors.NotFoundError({
|
return Promise.reject(new errors.NotFoundError({
|
||||||
message: i18n.t('errors.api.invites.inviteNotFound')
|
message: tpl(messages.inviteNotFound)
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,7 +82,7 @@ module.exports = {
|
||||||
.then(() => null)
|
.then(() => null)
|
||||||
.catch(models.Invite.NotFoundError, () => {
|
.catch(models.Invite.NotFoundError, () => {
|
||||||
return Promise.reject(new errors.NotFoundError({
|
return Promise.reject(new errors.NotFoundError({
|
||||||
message: i18n.t('errors.api.invites.inviteNotFound')
|
message: tpl(messages.inviteNotFound)
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue