diff --git a/src/app/profile/structure-edition-summary/structure-edition-summary.component.ts b/src/app/profile/structure-edition-summary/structure-edition-summary.component.ts index 569b61ab4f29bf96945016a976bf87aca12a73fe..1a66bb1db15c950a3c616daf403cd1ca9b7890e3 100644 --- a/src/app/profile/structure-edition-summary/structure-edition-summary.component.ts +++ b/src/app/profile/structure-edition-summary/structure-edition-summary.component.ts @@ -166,9 +166,13 @@ export class StructureEditionSummaryComponent implements OnInit { public goToEdit(step: structureFormStep, offer: any = null): void { this.isGoToEdit = true; if (offer?.user) { - this.router.navigateByUrl(`/profil/edition-offre-personnelle/${offer.offers._id}`, { - state: { structureName: this.structure.structureName }, - }); + if (offer.offers._id) { + this.router.navigateByUrl(`/profil/edition-offre-personnelle/${offer.offers._id}`, { + state: { structureName: this.structure.structureName }, + }); + } else { + this.router.navigate(['/formulaire/offre-personnelle'], { state: { structure: this.structure } }); + } } else { this.router.navigate(['/formulaire/structure', this.structure.permalink, structureFormStep[step]]); }