From 5626c31e7f0c28de73f15c91389a6ab2be37a9ee Mon Sep 17 00:00:00 2001 From: Nikodem Keller Date: Wed, 11 Sep 2024 00:01:12 +0200 Subject: [PATCH 1/2] cancel in route addition redirection fix --- src/app/route/route-edit/route-edit.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/route/route-edit/route-edit.component.ts b/src/app/route/route-edit/route-edit.component.ts index 384da7b..1a801dd 100644 --- a/src/app/route/route-edit/route-edit.component.ts +++ b/src/app/route/route-edit/route-edit.component.ts @@ -95,7 +95,11 @@ export class RouteEditComponent implements OnInit { if (this.editMode) { this.router.navigate(['../../../yourRoutes/' + this.id], { relativeTo: this.activatedRoute }); } else { - this.router.navigate(['../' + this.id], { relativeTo: this.activatedRoute }); + if (this.router.url.startsWith('/yourRoutes/new')) { + this.router.navigate(['/yourRoutes/list']); + } else { + this.router.navigate(['/routes/list']); + } } } From 1532da3ed7b1187c604c82ed2b4ddd278a98d209 Mon Sep 17 00:00:00 2001 From: Nikodem Keller Date: Thu, 12 Sep 2024 18:11:44 +0200 Subject: [PATCH 2/2] shorter --- src/app/route/route-edit/route-edit.component.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/app/route/route-edit/route-edit.component.ts b/src/app/route/route-edit/route-edit.component.ts index 1a801dd..db81572 100644 --- a/src/app/route/route-edit/route-edit.component.ts +++ b/src/app/route/route-edit/route-edit.component.ts @@ -95,11 +95,7 @@ export class RouteEditComponent implements OnInit { if (this.editMode) { this.router.navigate(['../../../yourRoutes/' + this.id], { relativeTo: this.activatedRoute }); } else { - if (this.router.url.startsWith('/yourRoutes/new')) { - this.router.navigate(['/yourRoutes/list']); - } else { - this.router.navigate(['/routes/list']); - } + this.router.navigate(['../list'], { relativeTo: this.activatedRoute }); } }