Ignore:
Timestamp:
11/11/21 12:59:26 (3 years ago)
Author:
Ema <ema_spirova@…>
Branches:
master
Children:
59329aa
Parents:
6c1585f
Message:

add location to planner

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trip-planner-front/src/app/_services/location.service.ts

    r6c1585f rceaed42  
    22import { Injectable } from "@angular/core";
    33import { Observable } from "rxjs";
     4import { PlannerLocationDto } from "../_models/dto/plannerLocationDto";
     5import { Location } from "../_models/location";
    46
    57@Injectable({
     
    911    constructor(private httpClient : HttpClient){}
    1012
    11     getLocationsFromCity(cityId: number, companionId: number, lengthOfStay: number, categoryIds: string): Observable<Object[]>{
     13    getLocationsFromCity(cityId: number, companionId: number, lengthOfStay: number, categoryIds: string): Observable<Location[]>{
    1214        let url = "http://localhost:8080/api/city/locations";
    1315        return this.httpClient.get<Location[]>(url + '?cityId=' + cityId + '&companionId=' + companionId + '&lengthOfStay=' + lengthOfStay + '&categoryIds='+ categoryIds);
     
    1820        return this.httpClient.get<Location[]>(url + '?regionId=' + regionId + '&companionId=' + companionId + '&lengthOfStay=' + lengthOfStay + '&categoryIds='+ categoryIds);
    1921    }
     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    }
    2032}
Note: See TracChangeset for help on using the changeset viewer.