mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 22:43:30 +03:00
Replaced i18n.t w/ tpl in api/v3/utils/validators/input/invites.js (#13514)
refs: #13380 - The i18n package is deprecated. It is being replaced with the tpl package.
This commit is contained in:
parent
6dcad04dcc
commit
e0b08c1ece
@ -1,15 +1,19 @@
|
||||
const Promise = require('bluebird');
|
||||
const i18n = require('../../../../../../shared/i18n');
|
||||
const tpl = require('@tryghost/tpl');
|
||||
const errors = require('@tryghost/errors');
|
||||
const models = require('../../../../../models');
|
||||
|
||||
const messages = {
|
||||
userAlreadyRegistered: 'User is already registered.'
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
add(apiConfig, frame) {
|
||||
return models.User.findOne({email: frame.data.invites[0].email}, frame.options)
|
||||
.then((user) => {
|
||||
if (user) {
|
||||
return Promise.reject(new errors.ValidationError({
|
||||
message: i18n.t('errors.api.users.userAlreadyRegistered')
|
||||
message: tpl(messages.userAlreadyRegistered)
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user