mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Replaced i18n.t w/ tpl in core/server/api/v3/utils/validators/input/oembed.js (#13516)
refs: #13380 - The i18n package is deprecated. It is being replaced with the tpl package.
This commit is contained in:
parent
e0b08c1ece
commit
a62c7acde2
1 changed files with 6 additions and 2 deletions
|
@ -1,12 +1,16 @@
|
||||||
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 messages = {
|
||||||
|
noUrlProvided: 'No url provided.'
|
||||||
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
read(apiConfig, frame) {
|
read(apiConfig, frame) {
|
||||||
if (!frame.data.url || !frame.data.url.trim()) {
|
if (!frame.data.url || !frame.data.url.trim()) {
|
||||||
return Promise.reject(new errors.BadRequestError({
|
return Promise.reject(new errors.BadRequestError({
|
||||||
message: i18n.t('errors.api.oembed.noUrlProvided')
|
message: tpl(messages.noUrlProvided)
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue