fix getWaypoints
This commit is contained in:
@@ -39,18 +39,22 @@ export class ReadjsonService{
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
getWaypoints(location: string, id: number): Observable<waypoint[]> {
|
getWaypoints(location: string, id: number): Observable<waypoint[]> {
|
||||||
return this.locations.pipe(
|
return this.locations.pipe(
|
||||||
map((locations) => {
|
map((locations) => {
|
||||||
const foundLocation: Locations | undefined = locations.find((loc: Locations) => loc.location === location);
|
const foundLocation: Locations | undefined = locations.find((loc: Locations) => loc.location === location);
|
||||||
|
if (foundLocation?.waypoints) {
|
||||||
return foundLocation ? foundLocation.waypoints.filter((way: waypoint) => way.id === id) : [];
|
return foundLocation ? foundLocation.waypoints.filter((way: waypoint) => way.id === id) : [];
|
||||||
|
} else {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
tap(data => console.log("data requested", data))
|
tap(data => console.log("data requested", data))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user