From 7232c8fe14c3b95ea28d60279b04194977df9596 Mon Sep 17 00:00:00 2001 From: Drillllll <118617644+Drillllll@users.noreply.github.com> Date: Wed, 3 Jul 2024 16:33:08 +0200 Subject: [PATCH] data update instead of navigation --- .../map-location-list/map-location-list.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 c28bd64..bd96d25 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 @@ -211,7 +211,11 @@ export class MapLocationListComponent implements OnInit, OnChanges { onMapLocationDelete(mapLocationId: string) { if (confirm("You are about to delete map location. Do you want to continue?")) { this.mapLocationService.deleteMapLocationFromRoute(mapLocationId, this.route.id).subscribe( () => { - this.router.navigate(['yourRoutes/list']) + //this.router.navigate(['yourRoutes/list']) + this.mapLocations = this.mapLocations.filter(location => location.id !== mapLocationId); + this.mapLocationsAndImages = this.mapLocationsAndImages.filter( + locationData => locationData.mapLocation.id !== mapLocationId + ); }); } }