7773-testToMaster_2430 #2774

Merged
alexm merged 368 commits from 7773-testToMaster_2430 into master 2024-07-23 06:21:03 +00:00
1 changed files with 7 additions and 4 deletions
Showing only changes of commit b871615e8f - Show all commits

View File

@ -193,9 +193,13 @@ module.exports = Self => {
}
await user.updateAttribute('email', email, myOptions);
const {countryFk} = await Self.app.models.Province.findById(provinceFk, {
let countryFk;
if (provinceFk) {
const province = await Self.app.models.Province.findById(provinceFk, {
fields: ['countryFk']
});
countryFk = province.countryFk;
}
await models.Worker.create({
id: user.id,
firstName,
@ -205,7 +209,6 @@ module.exports = Self => {
fi,
birth,
originCountryFk: countryFk
}, myOptions);
if (tx) await tx.commit();