Merge branch 'fix_update_users' into legacy_dev
All checks were successful
All checks were successful
This commit is contained in:
commit
c12e5e92d7
@ -256,6 +256,7 @@ export default class IdNotService extends BaseService {
|
|||||||
if (userData.deleted) {
|
if (userData.deleted) {
|
||||||
let rattachements: any;
|
let rattachements: any;
|
||||||
|
|
||||||
|
console.log("Fetching rattachements for user", user.uid);
|
||||||
try {
|
try {
|
||||||
rattachements = await fetch(`${this.variables.IDNOT_API_BASE_URL}/api/pp/v2/personnes/${user.idNot}/rattachements?deleted=false` + searchParams, {
|
rattachements = await fetch(`${this.variables.IDNOT_API_BASE_URL}/api/pp/v2/personnes/${user.idNot}/rattachements?deleted=false` + searchParams, {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
@ -383,14 +384,17 @@ export default class IdNotService extends BaseService {
|
|||||||
let updates = 0;
|
let updates = 0;
|
||||||
//093051 = demo
|
//093051 = demo
|
||||||
if (office.name !== officeData.denominationSociale && office.name !== officeData.codeCrpcen && office.crpcen !== "029178" && office.crpcen !== "035010" && office.crpcen !== "093051") {
|
if (office.name !== officeData.denominationSociale && office.name !== officeData.codeCrpcen && office.crpcen !== "029178" && office.crpcen !== "035010" && office.crpcen !== "093051") {
|
||||||
|
console.log(`Updating office name: ${office.uid} - ${office.name} - ${office.crpcen}`);
|
||||||
updates++;
|
updates++;
|
||||||
office.name = officeData.denominationSociale ?? officeData.codeCrpcen;
|
office.name = officeData.denominationSociale ?? officeData.codeCrpcen;
|
||||||
|
console.log(`New name: ${office.name}`);
|
||||||
}
|
}
|
||||||
if (office.office_status !== this.getOfficeStatus(officeData.statutEntite.name)) {
|
if (office.office_status !== this.getOfficeStatus(officeData.statutEntite.name)) {
|
||||||
|
console.log(`Updating office status: ${office.uid} - ${office.name} - ${office.crpcen}`);
|
||||||
updates++;
|
updates++;
|
||||||
office.office_status = this.getOfficeStatus(officeData.statutEntite.name);
|
office.office_status = this.getOfficeStatus(officeData.statutEntite.name);
|
||||||
|
console.log(`New status: ${office.office_status}`);
|
||||||
}
|
}
|
||||||
console.log(`Updating office: ${office.uid} - ${office.name} - ${office.crpcen}`);
|
|
||||||
if (updates != 0) await this.officeService.update(office.uid!, office);
|
if (updates != 0) await this.officeService.update(office.uid!, office);
|
||||||
await this.officeService.updateCheckedAt(office.uid!);
|
await this.officeService.updateCheckedAt(office.uid!);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user