refs #6397 emailValidation
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
2f67056dbf
commit
23b8703afc
|
@ -1,3 +1,5 @@
|
|||
const {error} = require('fancy-log');
|
||||
|
||||
module.exports = function(Self) {
|
||||
Self.remoteMethod('createWithUser', {
|
||||
description: 'Creates both client and its web account',
|
||||
|
@ -29,12 +31,15 @@ module.exports = function(Self) {
|
|||
myOptions.transaction = tx;
|
||||
}
|
||||
|
||||
const firstEmail = data.email ? data.email.split(',')[0] : null;
|
||||
const user = {
|
||||
name: data.userName,
|
||||
email: firstEmail,
|
||||
password: String(Math.random() * 100000000000000)
|
||||
};
|
||||
if (data.email) {
|
||||
const firstEmail = data.email ? data.email.split(',')[0] : null;
|
||||
const user = {
|
||||
name: data.userName,
|
||||
email: firstEmail,
|
||||
password: String(Math.random() * 100000000000000)
|
||||
};
|
||||
} else
|
||||
throw error;
|
||||
|
||||
try {
|
||||
const account = await models.VnUser.create(user, myOptions);
|
||||
|
|
Loading…
Reference in New Issue