This commit is contained in:
parent
b285c3e37a
commit
7176191193
|
@ -223,19 +223,15 @@ module.exports = Self => {
|
|||
const user = await models.VnUser.findById(client.id, null, myOptions);
|
||||
await user.updateAttribute('email', args.email, myOptions);
|
||||
|
||||
await models.Worker.rawSql(
|
||||
'CALL vn.workerCreate(?, ?, ?, ?, ?, ?, ?)',
|
||||
[
|
||||
args.firstName,
|
||||
args.lastNames,
|
||||
args.code,
|
||||
args.bossFk,
|
||||
client.id,
|
||||
args.fi,
|
||||
args.birth,
|
||||
],
|
||||
myOptions
|
||||
);
|
||||
await models.Worker.create({
|
||||
id: client.id,
|
||||
firstName: args.firstName,
|
||||
lastName: args.lastNames,
|
||||
code: args.code,
|
||||
bossFk: args.bossFk,
|
||||
fi: args.fi,
|
||||
birth: args.birth
|
||||
}, myOptions);
|
||||
|
||||
if (tx) await tx.commit();
|
||||
} catch (error) {
|
||||
|
|
|
@ -25,8 +25,7 @@
|
|||
"type" : "string"
|
||||
},
|
||||
"userFk": {
|
||||
"type" : "number",
|
||||
"required": true
|
||||
"type" : "number"
|
||||
},
|
||||
"bossFk": {
|
||||
"type" : "number"
|
||||
|
@ -51,6 +50,12 @@
|
|||
},
|
||||
"locker": {
|
||||
"type" : "number"
|
||||
},
|
||||
"fi": {
|
||||
"type" : "string"
|
||||
},
|
||||
"birth": {
|
||||
"type" : "date"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
|
|
Loading…
Reference in New Issue