From b5df21f8207b5e60379df505c6ec53fbe17f2f47 Mon Sep 17 00:00:00 2001 From: Nikodem Keller Date: Thu, 12 Sep 2024 20:49:14 +0200 Subject: [PATCH 1/2] redirect done --- .../map-location-edit/map-location-edit.component.ts | 6 +++++- .../map-location-list/map-location-list.component.ts | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/app/map-location/map-location-edit/map-location-edit.component.ts b/src/app/map-location/map-location-edit/map-location-edit.component.ts index 1dfe166..bcf7353 100644 --- a/src/app/map-location/map-location-edit/map-location-edit.component.ts +++ b/src/app/map-location/map-location-edit/map-location-edit.component.ts @@ -67,6 +67,10 @@ export class MapLocationEditComponent implements OnInit { } ) } else { + this.activatedRoute.queryParams.subscribe(params => { + this.routeId = params['routeId']; + console.log(this.routeId) + }); this.activatedRoute.params.subscribe( (params: Params) => { this.mapLocationId = params['pointId']; @@ -220,7 +224,7 @@ export class MapLocationEditComponent implements OnInit { goBack() { if (this.editMode) { - this.router.navigate(['yourRoutes/list']) + this.router.navigate(['yourRoutes/' + this.routeId]) } else { this.router.navigate(['yourRoutes/' + this.routeId + '/edit']); } diff --git a/src/app/map-location/map-location-list/map-location-list.component.ts b/src/app/map-location/map-location-list/map-location-list.component.ts index ce2d8f2..30e5b8a 100644 --- a/src/app/map-location/map-location-list/map-location-list.component.ts +++ b/src/app/map-location/map-location-list/map-location-list.component.ts @@ -100,7 +100,9 @@ export class MapLocationListComponent implements OnInit, OnChanges { } onMapLocationEdit(mapLocationId: string) { - this.router.navigate(['point/' + mapLocationId + '/edit']) + this.router.navigate(['point/' + mapLocationId + '/edit'], { + queryParams: { routeId: this.route.id } + }); } onMapLocationDelete(mapLocationId: string) { From 4bb062e42c73c32d5290a069b7b7077e392a8f3f Mon Sep 17 00:00:00 2001 From: Nikodem Keller Date: Thu, 12 Sep 2024 20:51:40 +0200 Subject: [PATCH 2/2] - console.log --- .../map-location-edit/map-location-edit.component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/map-location/map-location-edit/map-location-edit.component.ts b/src/app/map-location/map-location-edit/map-location-edit.component.ts index bcf7353..9137bd4 100644 --- a/src/app/map-location/map-location-edit/map-location-edit.component.ts +++ b/src/app/map-location/map-location-edit/map-location-edit.component.ts @@ -69,7 +69,6 @@ export class MapLocationEditComponent implements OnInit { } else { this.activatedRoute.queryParams.subscribe(params => { this.routeId = params['routeId']; - console.log(this.routeId) }); this.activatedRoute.params.subscribe( (params: Params) => {