0
Fork 0
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:
Ozan Uslan 2021-10-04 19:06:49 +03:00 committed by Hannah Wolfe
parent cb4915aed1
commit 12a839b29f

View file

@ -1,9 +1,13 @@
const errors = require('@tryghost/errors');
const i18n = require('../../../../../shared/i18n');
const tpl = require('@tryghost/tpl');
const auth = require('../../../../services/auth');
const shared = require('../../../shared');
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) {
// CASE: user is logged in, allow
if (!req.api_key) {
@ -38,7 +42,7 @@ const notImplemented = function (req, res, next) {
next(new errors.GhostError({
errorType: 'NotImplementedError',
message: i18n.t('errors.api.common.notImplemented'),
message: tpl(messages.notImplemented),
statusCode: '501'
}));
};