0
Fork 0
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:
william chandra 2021-10-11 19:59:40 +07:00 committed by GitHub
parent e0b08c1ece
commit a62c7acde2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,12 +1,16 @@
const Promise = require('bluebird');
const i18n = require('../../../../../../shared/i18n');
const tpl = require('@tryghost/tpl');
const errors = require('@tryghost/errors');
const messages = {
noUrlProvided: 'No url provided.'
};
module.exports = {
read(apiConfig, frame) {
if (!frame.data.url || !frame.data.url.trim()) {
return Promise.reject(new errors.BadRequestError({
message: i18n.t('errors.api.oembed.noUrlProvided')
message: tpl(messages.noUrlProvided)
}));
}
}