mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 05:50:35 +03:00
Replaced i18n.t w/ tpl in invites.js for canary
refs: TryGhost#13380 - The i18n package is deprecated. It is being replaced with the tpl package.
This commit is contained in:
parent
027e25a47f
commit
68de391c98
@ -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