diff --git a/src/app/service/http/waypointVisited.service.ts b/src/app/service/http/waypointVisited.service.ts index 9e0bff7..41ee165 100644 --- a/src/app/service/http/waypointVisited.service.ts +++ b/src/app/service/http/waypointVisited.service.ts @@ -1,12 +1,11 @@ import {Injectable} from "@angular/core"; import {HttpClient} from "@angular/common/http"; -import {catchError, Observable} from "rxjs"; -import {LocationEntity} from "../../interface/LocationEntity"; import {WaypointsEntity} from "../../interface/WaypointsEntity"; +import {WaypointsVisitedEntity} from "../../interface/WaypointsVisitedEntity"; const BASE_URL = "progetto152"; -const WAYPOINT_VISITED = BASE_URL + "/waypoint/visited/"; -const GET_WAYPOINT_BY_USER = WAYPOINT_VISITED + "USER/"; +const WAYPOINT_VISITED = BASE_URL + "/waypoint/visited"; +const GET_WAYPOINT_BY_USER = WAYPOINT_VISITED + "/USER/"; @Injectable({ @@ -20,26 +19,26 @@ export class WaypointVisitedService { } getWaypoints() { - return this.http.get(WAYPOINT_VISITED); + return this.http.get(WAYPOINT_VISITED); } getwaypointVisited(id: number) { - return this.http.get(WAYPOINT_VISITED + id); + return this.http.get(WAYPOINT_VISITED +"/"+ id); } getWaypointByUser(user: string) { - return this.http.get(GET_WAYPOINT_BY_USER + user); + return this.http.get(GET_WAYPOINT_BY_USER + user); } - createWaypoint(waypoint: WaypointsEntity) { - return this.http.post(WAYPOINT_VISITED, waypoint); + createWaypoint(waypointvisited: WaypointsVisitedEntity) { + return this.http.post(WAYPOINT_VISITED, waypointvisited); } - updateWaypoint(waypoint: WaypointsEntity, id: number) { - return this.http.put(WAYPOINT_VISITED + id, waypoint); + updateWaypoint(waypoint: WaypointsVisitedEntity, id: number) { + return this.http.put(WAYPOINT_VISITED +"/"+ id, waypoint); } deleteWaypoint(id: number) { - return this.http.delete(WAYPOINT_VISITED + id); + return this.http.delete(WAYPOINT_VISITED + id); } }