source: trip-planner-front/src/app/_services/location.service.ts@ 6c1585f

Last change on this file since 6c1585f was 188ee53, checked in by Ema <ema_spirova@…>, 3 years ago

location-form

  • Property mode set to 100644
File size: 1000 bytes
Line 
1import { HttpClient } from "@angular/common/http";
2import { Injectable } from "@angular/core";
3import { Observable } from "rxjs";
4
5@Injectable({
6 providedIn: 'root'
7})
8export class LocationService{
9 constructor(private httpClient : HttpClient){}
10
11 getLocationsFromCity(cityId: number, companionId: number, lengthOfStay: number, categoryIds: string): Observable<Object[]>{
12 let url = "http://localhost:8080/api/city/locations";
13 return this.httpClient.get<Location[]>(url + '?cityId=' + cityId + '&companionId=' + companionId + '&lengthOfStay=' + lengthOfStay + '&categoryIds='+ categoryIds);
14 }
15
16 getLocationsFromRegion(regionId: number, companionId: number, lengthOfStay: number, categoryIds: string):Observable<Object[]>{
17 let url = "http://localhost:8080/api/region/locations";
18 return this.httpClient.get<Location[]>(url + '?regionId=' + regionId + '&companionId=' + companionId + '&lengthOfStay=' + lengthOfStay + '&categoryIds='+ categoryIds);
19 }
20}
Note: See TracBrowser for help on using the repository browser.