Ignore:
Timestamp:
11/02/21 22:14:57 (3 years ago)
Author:
Ema <ema_spirova@…>
Branches:
master
Children:
6c1585f
Parents:
188ee53
Message:

create initial planner and routing with angular

File:
1 edited

Legend:

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

    r188ee53 r6a80231  
    1 import { HttpClient } from "@angular/common/http";
     1import { HttpClient, HttpHeaders } from "@angular/common/http";
    22import { Injectable } from "@angular/core";
    33import { Observable } from "rxjs";
     4import { PlannerDto } from "../_models/dto/plannerDto";
    45import { Planner } from "../_models/planner";
    56
     
    1415        return this.httpClient.get<Planner[]>(url);
    1516    }
     17
     18    postInitialPlanner(plannerDto: PlannerDto): Observable<Object>{     
     19        let url = "http://localhost:8080/api/planner/new";
     20        return this.httpClient.post<Planner>(url, plannerDto);
     21    }
     22
     23    updatePlanner(id: number):Observable<Planner>{   
     24    let url = "http://localhost:8080/api/edit/planner/" + id;
     25    return this.httpClient.put<Planner>(url, null);
     26    }
    1627}
Note: See TracChangeset for help on using the changeset viewer.