This commit is contained in:
parent
23b8703afc
commit
7cb7c7dace
|
@ -72,7 +72,7 @@
|
||||||
"The secret can't be blank": "La contraseña no puede estar en blanco",
|
"The secret can't be blank": "La contraseña no puede estar en blanco",
|
||||||
"We weren't able to send this SMS": "No hemos podido enviar el SMS",
|
"We weren't able to send this SMS": "No hemos podido enviar el SMS",
|
||||||
"This client can't be invoiced": "Este cliente no puede ser facturado",
|
"This client can't be invoiced": "Este cliente no puede ser facturado",
|
||||||
"You must provide the correction information to generate a corrective invoice": "Debes informar la información de corrección para generar una factura rectificativa",
|
"You must provide the correction information to generate a corrective invoice": "Debes informar la información de corrección para generar una factura rectificativa",
|
||||||
"This ticket can't be invoiced": "Este ticket no puede ser facturado",
|
"This ticket can't be invoiced": "Este ticket no puede ser facturado",
|
||||||
"You cannot add or modify services to an invoiced ticket": "No puedes añadir o modificar servicios a un ticket facturado",
|
"You cannot add or modify services to an invoiced ticket": "No puedes añadir o modificar servicios a un ticket facturado",
|
||||||
"This ticket can not be modified": "Este ticket no puede ser modificado",
|
"This ticket can not be modified": "Este ticket no puede ser modificado",
|
||||||
|
@ -336,5 +336,6 @@
|
||||||
"Incorrect pin": "Pin incorrecto.",
|
"Incorrect pin": "Pin incorrecto.",
|
||||||
"You already have the mailAlias": "Ya tienes este alias de correo",
|
"You already have the mailAlias": "Ya tienes este alias de correo",
|
||||||
"The alias cant be modified": "Este alias de correo no puede ser modificado",
|
"The alias cant be modified": "Este alias de correo no puede ser modificado",
|
||||||
"No tickets to invoice": "No hay tickets para facturar"
|
"No tickets to invoice": "No hay tickets para facturar",
|
||||||
}
|
"An email is necessary": "An email is necessary"
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
const {error} = require('fancy-log');
|
const UserError = require('vn-loopback/util/user-error');
|
||||||
|
|
||||||
module.exports = function(Self) {
|
module.exports = function(Self) {
|
||||||
Self.remoteMethod('createWithUser', {
|
Self.remoteMethod('createWithUser', {
|
||||||
|
@ -31,15 +31,16 @@ module.exports = function(Self) {
|
||||||
myOptions.transaction = tx;
|
myOptions.transaction = tx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let user;
|
||||||
if (data.email) {
|
if (data.email) {
|
||||||
const firstEmail = data.email ? data.email.split(',')[0] : null;
|
const firstEmail = data.email ? data.email.split(',')[0] : null;
|
||||||
const user = {
|
user = {
|
||||||
name: data.userName,
|
name: data.userName,
|
||||||
email: firstEmail,
|
email: firstEmail,
|
||||||
password: String(Math.random() * 100000000000000)
|
password: String(Math.random() * 100000000000000)
|
||||||
};
|
};
|
||||||
} else
|
} else
|
||||||
throw error;
|
throw new UserError(`An email is necessary`);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const account = await models.VnUser.create(user, myOptions);
|
const account = await models.VnUser.create(user, myOptions);
|
||||||
|
|
Loading…
Reference in New Issue