Changeset b738035 for trip-planner-front/src/app/planner/edit-planner
- Timestamp:
- 01/24/22 21:08:32 (3 years ago)
- Branches:
- master
- Children:
- 76712b2
- Parents:
- bdd6491
- Location:
- trip-planner-front/src/app/planner/edit-planner
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trip-planner-front/src/app/planner/edit-planner/edit-planner.component.html
rbdd6491 rb738035 38 38 </td> 39 39 <td> 40 <button pButton pRipple type="button" icon="pi pi-times" class="p-button-rounded p-button-danger p-button-text" ></button>40 <button pButton pRipple type="button" icon="pi pi-times" class="p-button-rounded p-button-danger p-button-text" (click)="onClickRemoveLocation(planner, location)"></button> 41 41 </td> 42 42 </tr> -
trip-planner-front/src/app/planner/edit-planner/edit-planner.component.ts
rbdd6491 rb738035 3 3 import { ActivatedRoute, Router } from '@angular/router'; 4 4 import { PlannerDto } from 'src/app/_models/dto/plannerDto'; 5 import { PlannerLocationDto } from 'src/app/_models/dto/plannerLocationDto'; 5 6 import { Location } from 'src/app/_models/location'; 6 7 import { Planner } from 'src/app/_models/planner'; … … 21 22 id: number; 22 23 locations: Location[]; 23 24 plannerLocationDto: PlannerLocationDto; 24 25 25 26 constructor(private router: Router, private route: ActivatedRoute, private fb: FormBuilder, private plannerService: PlannerService, … … 33 34 this.id = 1; 34 35 this.locations = []; 36 this.plannerLocationDto = new PlannerLocationDto(); 35 37 } 36 38 … … 64 66 } 65 67 66 privateupdatePlanner() {68 updatePlanner() { 67 69 this.plannerService.updatePlanner(this.id, this.form.value) 68 70 .pipe() … … 81 83 } 82 84 83 onClickRemoveLocation(id : number){ 84 85 onClickRemoveLocation(planner: Planner, location: Location) { 86 planner.id = this.id; 87 88 this.plannerLocationDto.plannerId = planner.id; 89 this.plannerLocationDto.locationId = location.id; 90 console.log(this.plannerLocationDto.plannerId); 91 console.log(this.plannerLocationDto.locationId); 92 this.plannerService.deleteLocationFromPlanner(this.plannerLocationDto).subscribe( 93 data => { 94 console.log("deleted") 95 } 96 ); 97 window.location.reload(); 85 98 } 86 99 }
Note:
See TracChangeset
for help on using the changeset viewer.