mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Replaced i18n.t w/ tpl in v2/integrations.js (#13497)
refs: TryGhost#13380 - The i18n package is deprecated. It is being replaced with the tpl package.
This commit is contained in:
parent
eca69da254
commit
4b742adafc
1 changed files with 8 additions and 10 deletions
|
@ -1,7 +1,11 @@
|
|||
const i18n = require('../../../shared/i18n');
|
||||
const tpl = require('@tryghost/tpl');
|
||||
const errors = require('@tryghost/errors');
|
||||
const models = require('../../models');
|
||||
|
||||
const messages = {
|
||||
resourceNotFound: '{resource} not found.'
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
docName: 'integrations',
|
||||
browse: {
|
||||
|
@ -45,9 +49,7 @@ module.exports = {
|
|||
return models.Integration.findOne(data, Object.assign(options, {require: true}))
|
||||
.catch(models.Integration.NotFoundError, () => {
|
||||
throw new errors.NotFoundError({
|
||||
message: i18n.t('errors.api.resource.resourceNotFound', {
|
||||
resource: 'Integration'
|
||||
})
|
||||
message: tpl(messages.resourceNotFound, {resource: 'Integration'})
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -78,9 +80,7 @@ module.exports = {
|
|||
return models.Integration.edit(data, Object.assign(options, {require: true}))
|
||||
.catch(models.Integration.NotFoundError, () => {
|
||||
throw new errors.NotFoundError({
|
||||
message: i18n.t('errors.api.resource.resourceNotFound', {
|
||||
resource: 'Integration'
|
||||
})
|
||||
message: tpl(messages.resourceNotFound, {resource: 'Integration'})
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -136,9 +136,7 @@ module.exports = {
|
|||
return models.Integration.destroy(Object.assign(options, {require: true}))
|
||||
.catch(models.Integration.NotFoundError, () => {
|
||||
return Promise.reject(new errors.NotFoundError({
|
||||
message: i18n.t('errors.api.resource.resourceNotFound', {
|
||||
resource: 'Integration'
|
||||
})
|
||||
message: tpl(messages.resourceNotFound, {resource: 'Integration'})
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue