From f7d6d19b5b255e215234ff992e4ebd47304c0110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joe=20Ku=CC=88ng?= Date: Wed, 3 May 2023 15:04:39 +0200 Subject: [PATCH] fix waypointVisited --- .../service/http/waypointVisited.service.ts | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) 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); } }