diff --git a/src/app/map-location/map-location-list/map-location-list.component.html b/src/app/map-location/map-location-list/map-location-list.component.html index aab8da8..0179808 100644 --- a/src/app/map-location/map-location-list/map-location-list.component.html +++ b/src/app/map-location/map-location-list/map-location-list.component.html @@ -20,12 +20,12 @@ -
  • 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 62ecef9..d7e2e91 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 @@ -64,7 +64,7 @@ export class MapLocationListComponent implements OnInit, OnChanges { userMode = false; addingPointToRoute = false; - addingPointToRouteId: string; + pointIdToBeAdded: string; constructor(private mapService: MapService, private sidePanelService: SidePanelService, @@ -225,7 +225,7 @@ export class MapLocationListComponent implements OnInit, OnChanges { } onAddToYourRoute(mapLocationId: string) { - this.addingPointToRouteId = mapLocationId; + this.pointIdToBeAdded = mapLocationId; this.addingPointToRoute = !this.addingPointToRoute; } } diff --git a/src/app/route-map-location/route-map-location.service.ts b/src/app/route-map-location/route-map-location.service.ts index 80b9fbc..e26cbae 100644 --- a/src/app/route-map-location/route-map-location.service.ts +++ b/src/app/route-map-location/route-map-location.service.ts @@ -27,7 +27,7 @@ export class RouteMapLocationService { return this.http.post(url, newRouteMapLocation); } else { alert('This map Location is already in your route!') - return of(null); // Zwraca Observable z wartością `null`, gdy rekord już istnieje + return of(null); } }) ); diff --git a/src/app/route/route-list/route-list.component.ts b/src/app/route/route-list/route-list.component.ts index 7c2e154..7e8c686 100644 --- a/src/app/route/route-list/route-list.component.ts +++ b/src/app/route/route-list/route-list.component.ts @@ -36,7 +36,7 @@ export class RouteListComponent { selectedRoute: Route; @Input() addingPointToRoute: boolean = false; - @Input() addingPointToRouteId: string; + @Input() pointIdToBeAdded: string; constructor(private routeService: RouteService, private mapLocationService: MapLocationService, private mapService: MapService, private router: Router, @@ -184,7 +184,7 @@ export class RouteListComponent { addPointToRoute() { if (confirm("You are about to add point to " + this.selectedRoute.name + " route.")) { - this.routeMapLocationService.postRouteMapLocation(this.selectedRoute.id, this.addingPointToRouteId) + this.routeMapLocationService.postRouteMapLocation(this.selectedRoute.id, this.pointIdToBeAdded) .subscribe( response => { this.router.navigate(['../list'], {relativeTo: this.activatedRoute}) });