Changeset b738035 for trip-planner-front/src/app/_services
- Timestamp:
- 01/24/22 21:08:32 (3 years ago)
- Branches:
- master
- Children:
- 76712b2
- Parents:
- bdd6491
- Location:
- trip-planner-front/src/app/_services
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trip-planner-front/src/app/_services/location.service.ts
rbdd6491 rb738035 23 23 postLocationToPlanner(plannerLocationDto : PlannerLocationDto) : Observable<Location>{ 24 24 let url = "http://localhost:8080/api/add-location"; 25 return this.httpClient.p ut<Location>(url, plannerLocationDto);25 return this.httpClient.post<Location>(url, plannerLocationDto); 26 26 } 27 27 -
trip-planner-front/src/app/_services/planner.service.ts
rbdd6491 rb738035 3 3 import { Observable } from "rxjs"; 4 4 import { PlannerDto } from "../_models/dto/plannerDto"; 5 import { PlannerLocationDto } from "../_models/dto/plannerLocationDto"; 5 6 import { Planner } from "../_models/planner"; 6 7 … … 15 16 'Content-Type': 'application/json' 16 17 }); 17 18 18 19 19 constructor(private httpClient: HttpClient) { … … 30 30 postInitialPlanner(plannerDto: PlannerDto): Observable<Planner> { 31 31 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}); 33 33 } 34 34 … … 47 47 return this.httpClient.delete<Planner>(url, { headers: this.httpHeaders }); 48 48 } 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 49 62 } -
trip-planner-front/src/app/_services/user.service.ts
rbdd6491 rb738035 43 43 let user = sessionStorage.getItem("username"); 44 44 let token = sessionStorage.getItem("token"); 45 console.log(user);46 console.log(token);47 console.log(!(user === null));48 45 return !(user === null); 49 46 } 50 47 48 getAllUsernames() { 49 let url = "http://localhost:8080/api/users/usernames"; 50 return this.httpClient.get<string[]>(url); 51 } 52 53 getPassword(loginRequest : LoginRequest){ 54 let url="http://localhost:8080/api/users/password"; 55 const options = { 56 57 body: { 58 "username": loginRequest.username 59 60 } 61 } 62 return this.httpClient.request('get', url, options); 63 } 64 51 65 }
Note:
See TracChangeset
for help on using the changeset viewer.