Ignore:
Timestamp:
01/24/22 21:08:32 (3 years ago)
Author:
Ema <ema_spirova@…>
Branches:
master
Children:
76712b2
Parents:
bdd6491
Message:

signup/login server errors on front and remove location from planner

File:
1 edited

Legend:

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

    rbdd6491 rb738035  
    33import { Observable } from "rxjs";
    44import { PlannerDto } from "../_models/dto/plannerDto";
     5import { PlannerLocationDto } from "../_models/dto/plannerLocationDto";
    56import { Planner } from "../_models/planner";
    67
     
    1516        'Content-Type': 'application/json'
    1617    });
    17 
    1818
    1919    constructor(private httpClient: HttpClient) {
     
    3030    postInitialPlanner(plannerDto: PlannerDto): Observable<Planner> {
    3131        let url = "http://localhost:8080/api/planner/new";
    32         return this.httpClient.post<Planner>(url, plannerDto);
     32        return this.httpClient.post<Planner>(url, plannerDto, {headers: this.httpHeaders});
    3333    }
    3434
     
    4747        return this.httpClient.delete<Planner>(url, { headers: this.httpHeaders });
    4848    }
     49
     50    deleteLocationFromPlanner(plannerLocationDto : PlannerLocationDto) {
     51        let url = "http://localhost:8080/api/delete-location";
     52        const options = {
     53            body: {
     54                "plannerId": plannerLocationDto.plannerId,
     55                "locationId": plannerLocationDto.locationId
     56            }
     57        }
     58        return this.httpClient.request('delete', url, options);
     59    }
     60 
     61
    4962}
Note: See TracChangeset for help on using the changeset viewer.