Merge branch 'fix_update_users' into legacy_dev
All checks were successful
All checks were successful
This commit is contained in:
commit
70c481e545
@ -246,6 +246,7 @@ export default class IdNotService extends BaseService {
|
||||
return;
|
||||
} else if (userRawData.status !== 200) {
|
||||
console.error(`Error fetching user data for ${user.uid}: ${userRawData.status} - ${userRawData.statusText}`);
|
||||
console.error(await userRawData.text());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -256,6 +257,8 @@ export default class IdNotService extends BaseService {
|
||||
if (userData.deleted) {
|
||||
let rattachements: any;
|
||||
|
||||
console.log("Fetching rattachements for user", user.uid);
|
||||
console.log(searchParams.toString());
|
||||
try {
|
||||
rattachements = await fetch(`${this.variables.IDNOT_API_BASE_URL}/api/pp/v2/personnes/${user.idNot}/rattachements?deleted=false` + searchParams, {
|
||||
method: "GET",
|
||||
@ -383,14 +386,17 @@ export default class IdNotService extends BaseService {
|
||||
let updates = 0;
|
||||
//093051 = demo
|
||||
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++;
|
||||
office.name = officeData.denominationSociale ?? officeData.codeCrpcen;
|
||||
console.log(`New name: ${office.name}`);
|
||||
}
|
||||
if (office.office_status !== this.getOfficeStatus(officeData.statutEntite.name)) {
|
||||
console.log(`Updating office status: ${office.uid} - ${office.name} - ${office.crpcen}`);
|
||||
updates++;
|
||||
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);
|
||||
await this.officeService.updateCheckedAt(office.uid!);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user