Updated userData includes office
All checks were successful
All checks were successful
This commit is contained in:
parent
dfc20ab438
commit
4f0f33a23f
@ -300,8 +300,11 @@ export default class IdNotService extends BaseService {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("officeData", JSON.stringify(officeData));
|
||||
|
||||
if (officeData.typeEntite.name === "office") {
|
||||
userData = rattachement;
|
||||
userData.entite = officeData;
|
||||
console.log("Updated userData", JSON.stringify(userData));
|
||||
}
|
||||
}
|
||||
@ -310,7 +313,6 @@ export default class IdNotService extends BaseService {
|
||||
|
||||
let updates = 0;
|
||||
|
||||
|
||||
if (user.office_membership!.idNot !== userData.entite.ou) {
|
||||
updates++;
|
||||
let officeData = (await this.officeService.get({ where: { idNot: userData.entite.ou } }))[0];
|
||||
@ -346,15 +348,18 @@ export default class IdNotService extends BaseService {
|
||||
officeData = await this.officeService.create(office);
|
||||
}
|
||||
user.office_membership = officeData;
|
||||
console.log("Updated user.office_membership", JSON.stringify(user.office_membership));
|
||||
}
|
||||
|
||||
if (user.contact!.email !== userData.mailRattachement) {
|
||||
updates++;
|
||||
user.contact!.email = userData.mailRattachement;
|
||||
console.log("Updated user.contact.email", JSON.stringify(user.contact!.email));
|
||||
}
|
||||
if (user.contact!.cell_phone_number !== userData.numeroMobile) {
|
||||
updates++;
|
||||
user.contact!.cell_phone_number = userData.numeroMobile;
|
||||
console.log("Updated user.contact.cell_phone_number", JSON.stringify(user.contact!.cell_phone_number));
|
||||
}
|
||||
if (updates != 0) await this.userService.update(user.uid!, user);
|
||||
await this.userService.updateCheckedAt(user.uid!);
|
||||
|
Loading…
x
Reference in New Issue
Block a user