From 7ac64fa2539ae9784da9b908aba556f44a444e8c Mon Sep 17 00:00:00 2001
From: Etienne LOUPIAS <eloupias@grandlyon.com>
Date: Mon, 24 Oct 2022 15:39:50 +0200
Subject: [PATCH] fix issue 43

---
 src/app/form/form-view/form-view.component.ts | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/app/form/form-view/form-view.component.ts b/src/app/form/form-view/form-view.component.ts
index e7e262de2..3e5f7acea 100644
--- a/src/app/form/form-view/form-view.component.ts
+++ b/src/app/form/form-view/form-view.component.ts
@@ -97,9 +97,6 @@ export class FormViewComponent implements OnInit {
         if (this.profile.structuresLink.length) {
           // if register a new user as a new member structure, no structure to choose
           this.isRegisterNewMember = true;
-          this.structureService.getStructure(this.profile.structuresLink[0]).subscribe((structure) => {
-            this.structure = new Structure(structure);
-          });
         }
       }
     });
@@ -340,7 +337,10 @@ export class FormViewComponent implements OnInit {
       // if register a new user as a new member structure, no structure to choose
       if (this.isRegisterNewMember) {
         if (this.profile.job && this.profile.job.hasPersonalOffer) {
-          this.router.navigateByUrl('form/personaloffer');
+          this.structureService.getStructure(this.profile.structuresLink[0]).subscribe((structure) => {
+            this.structure = new Structure(structure);
+            this.router.navigateByUrl('form/personaloffer');
+          });
         } else {
           this.router.navigateByUrl('/profile');
         }
-- 
GitLab