Last change
on this file since 188ee53 was 188ee53, checked in by Ema <ema_spirova@…>, 3 years ago |
location-form
|
-
Property mode
set to
100644
|
File size:
1000 bytes
|
Rev | Line | |
---|
[eed0bf8] | 1 | import { HttpClient } from "@angular/common/http";
|
---|
| 2 | import { Injectable } from "@angular/core";
|
---|
| 3 | import { Observable } from "rxjs";
|
---|
| 4 |
|
---|
| 5 | @Injectable({
|
---|
| 6 | providedIn: 'root'
|
---|
| 7 | })
|
---|
| 8 | export class LocationService{
|
---|
| 9 | constructor(private httpClient : HttpClient){}
|
---|
| 10 |
|
---|
[188ee53] | 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);
|
---|
[eed0bf8] | 19 | }
|
---|
| 20 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.