refs #6397 refactor
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Satorres 2024-01-19 14:53:56 +01:00
parent 391f418883
commit 73e1b52348
1 changed files with 10 additions and 10 deletions

View File

@ -31,16 +31,16 @@ module.exports = function(Self) {
myOptions.transaction = tx;
}
let user;
if (data.email) {
const firstEmail = data.email ? data.email.split(',')[0] : null;
user = {
name: data.userName,
email: firstEmail,
password: String(Math.random() * 100000000000000)
};
} else
throw new UserError(`An email is necessary`);
if (!data.email)
throw new UserError('An email is necessary');
const firstEmail = data.email.split(',')[0];
const user = {
name: data.userName,
email: firstEmail,
password: String(Math.random() * 100000000000000)
};
try {
const account = await models.VnUser.create(user, myOptions);