From c8f7c3e08e5853294796d770ad39072695a0b500 Mon Sep 17 00:00:00 2001 From: Sosthene Date: Wed, 27 Aug 2025 17:40:40 +0200 Subject: [PATCH] Remove broken completeOfficeRoles --- .../Api/LeCoffreApi/sdk/OfficeRoleService.ts | 29 ++----------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/src/common/Api/LeCoffreApi/sdk/OfficeRoleService.ts b/src/common/Api/LeCoffreApi/sdk/OfficeRoleService.ts index c316cdfc..9b7d099d 100644 --- a/src/common/Api/LeCoffreApi/sdk/OfficeRoleService.ts +++ b/src/common/Api/LeCoffreApi/sdk/OfficeRoleService.ts @@ -93,8 +93,6 @@ export default class OfficeRoleService extends AbstractService { return items; } else { for (let process of processes) { - process = await this.completeOfficeRole(process); - // Update cache this.setItem('_office_roles_', process); @@ -121,14 +119,11 @@ export default class OfficeRoleService extends AbstractService { publicValues['isDeleted'] && publicValues['isDeleted'] === 'false' ).then(async (processes: any[]) => { - if (processes.length === 0) { + if (processes.length !== 1) { resolve(null); } else { - let process: any = processes[0]; - process = await this.completeOfficeRole(process); - // Update cache - this.setItem('_office_roles_', process); + this.setItem('_office_roles_', processes[0]); resolve(process); } @@ -152,24 +147,4 @@ export default class OfficeRoleService extends AbstractService { }); } - private static async completeOfficeRole(process: any): Promise { - if (process.processData.office) { - process.processData.office = await new Promise(async (resolve: (office: any) => void) => { - const office: any = (await OfficeService.getOfficeByUid(process.processData.office.uid)).processData; - resolve(office); - }); - } - - if (process.processData.rules && process.processData.rules.length > 0) { - process.processData.rules = await new Promise(async (resolve: (rules: any[]) => void) => { - const rules: any[] = []; - for (const rule of process.processData.rules) { - rules.push((await RuleService.getRuleByUid(rule.uid)).processData); - } - resolve(rules); - }); - } - - return process; - } }