From e2f756bd1c0086d15f8949e0b09db8f71913c18d Mon Sep 17 00:00:00 2001
From: Alex ORLUC <alex.orluc@maarch.org>
Date: Thu, 8 Oct 2020 10:42:34 +0200
Subject: [PATCH] FEAT #14790 TIME 0:15 add param in route roles

---
 .../app/diffusions/diffusions-list.component.ts  | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/src/frontend/app/diffusions/diffusions-list.component.ts b/src/frontend/app/diffusions/diffusions-list.component.ts
index 9470acafd61..ac04b9f4d00 100644
--- a/src/frontend/app/diffusions/diffusions-list.component.ts
+++ b/src/frontend/app/diffusions/diffusions-list.component.ts
@@ -103,7 +103,6 @@ export class DiffusionsListComponent implements OnInit {
     ) { }
 
     async ngOnInit(): Promise<void> {
-        await this.initParams();
         await this.initRoles();
         if (this.resId !== null && this.resId != 0 && this.target !== 'redirect') {
             this.loadListinstance(this.resId);
@@ -332,11 +331,12 @@ export class DiffusionsListComponent implements OnInit {
         return new Promise((resolve, reject) => {
             this.http.get(`../rest/roles?context=${this.target}`).pipe(
                 map((data: any) => {
+                    this.keepDiffusionRoleInOutgoingIndexation = data.parameters['keepDiffusionRoleInOutgoingIndexation'];
                     data.roles = data.roles.map((role: any) => {
                         return {
                             ...role,
                             id: role.id,
-                        }
+                        };
                     });
                     return data.roles;
                 }),
@@ -362,18 +362,6 @@ export class DiffusionsListComponent implements OnInit {
         });
     }
 
-    initParams() {
-        return new Promise((resolve, reject) => {
-            this.http.get('../rest/parameters/keepDiffusionRoleInOutgoingIndexation')
-                .subscribe((data: any) => {
-                    this.keepDiffusionRoleInOutgoingIndexation = data.parameter.param_value_int;
-                    resolve(true);
-                }, (err) => {
-                    this.notify.handleSoftErrors(err);
-                });
-        });
-    }
-
     deleteItem(roleId: string, index: number) {
         this.diffList[roleId].items.splice(index, 1);
         if (this.diffFormControl !== undefined) {
-- 
GitLab