- Timestamp:
- 11/11/21 12:59:26 (3 years ago)
- Branches:
- master
- Children:
- 59329aa
- Parents:
- 6c1585f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trip-planner-front/src/app/_services/location.service.ts
r6c1585f rceaed42 2 2 import { Injectable } from "@angular/core"; 3 3 import { Observable } from "rxjs"; 4 import { PlannerLocationDto } from "../_models/dto/plannerLocationDto"; 5 import { Location } from "../_models/location"; 4 6 5 7 @Injectable({ … … 9 11 constructor(private httpClient : HttpClient){} 10 12 11 getLocationsFromCity(cityId: number, companionId: number, lengthOfStay: number, categoryIds: string): Observable< Object[]>{13 getLocationsFromCity(cityId: number, companionId: number, lengthOfStay: number, categoryIds: string): Observable<Location[]>{ 12 14 let url = "http://localhost:8080/api/city/locations"; 13 15 return this.httpClient.get<Location[]>(url + '?cityId=' + cityId + '&companionId=' + companionId + '&lengthOfStay=' + lengthOfStay + '&categoryIds='+ categoryIds); … … 18 20 return this.httpClient.get<Location[]>(url + '?regionId=' + regionId + '&companionId=' + companionId + '&lengthOfStay=' + lengthOfStay + '&categoryIds='+ categoryIds); 19 21 } 22 23 postLocationToPlanner(plannerLocationDto : PlannerLocationDto) : Observable<Location>{ 24 let url = "http://localhost:8080/api/add-location"; 25 return this.httpClient.put<Location>(url, plannerLocationDto); 26 } 27 28 getLocationsFroPlanner(plannerId : number) : Observable<Location[]>{ 29 let url = "http://localhost:8080/api/planner/locations"; 30 return this.httpClient.get<Location[]>(url + '?plannerId=' + plannerId); 31 } 20 32 }
Note:
See TracChangeset
for help on using the changeset viewer.