mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Replaced i18n.t w/ tpl in middleware.js in api/v2/admin
refs: TryGhost#13380 - The i18n package is deprecated. It is being replaced with the tpl package.
This commit is contained in:
parent
cb4915aed1
commit
12a839b29f
1 changed files with 6 additions and 2 deletions
|
@ -1,9 +1,13 @@
|
||||||
const errors = require('@tryghost/errors');
|
const errors = require('@tryghost/errors');
|
||||||
const i18n = require('../../../../../shared/i18n');
|
const tpl = require('@tryghost/tpl');
|
||||||
const auth = require('../../../../services/auth');
|
const auth = require('../../../../services/auth');
|
||||||
const shared = require('../../../shared');
|
const shared = require('../../../shared');
|
||||||
const apiMw = require('../../middleware');
|
const apiMw = require('../../middleware');
|
||||||
|
|
||||||
|
const messages = {
|
||||||
|
notImplemented: 'The server does not support the functionality required to fulfill the request.'
|
||||||
|
};
|
||||||
|
|
||||||
const notImplemented = function (req, res, next) {
|
const notImplemented = function (req, res, next) {
|
||||||
// CASE: user is logged in, allow
|
// CASE: user is logged in, allow
|
||||||
if (!req.api_key) {
|
if (!req.api_key) {
|
||||||
|
@ -38,7 +42,7 @@ const notImplemented = function (req, res, next) {
|
||||||
|
|
||||||
next(new errors.GhostError({
|
next(new errors.GhostError({
|
||||||
errorType: 'NotImplementedError',
|
errorType: 'NotImplementedError',
|
||||||
message: i18n.t('errors.api.common.notImplemented'),
|
message: tpl(messages.notImplemented),
|
||||||
statusCode: '501'
|
statusCode: '501'
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue