mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 13:54:35 +03:00
Replaced i18n with tpl in oembed.js (#13472)
refs: #13380 - The i18n package is deprecated. It is being replaced with the tpl package.
This commit is contained in:
parent
3255c806f8
commit
940d10fc3b
@ -1,12 +1,13 @@
|
||||
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)
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user