Ignore:
Timestamp:
10/19/21 16:40:43 (3 years ago)
Author:
Ema <ema_spirova@…>
Branches:
master
Children:
6a80231
Parents:
eed0bf8
Message:

location-form

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trip-planner-front/src/app/locations-form/locations-form.component.ts

    reed0bf8 r188ee53  
    3535  locationId: number;
    3636  regionId: number;
     37  cityId: number;
    3738  companionId: number;
    3839  lengthOfStay: number;
    3940  cityOption: boolean = false;
    4041  regionOption: boolean = false;
     42  value:number;
     43  max: number;
    4144
    4245  constructor(private cityService : CityService, private regionService: RegionService,
     
    5457    this.categoryIds = '';
    5558    this.regionId = 0;
     59    this.cityId = 0;
     60    this.value = 0;
     61    this.max = 30;
    5662  }
    5763 
     
    119125 createMyPlanner(){
    120126   this.categoryIds = this.chipsSeletion.join(',');
    121    console.log(this.companionId);
    122    this.locationService.getAllPlaces(this.locationId, this.companionId, this.lengthOfStay, this.categoryIds).subscribe(
    123      result => {
    124        console.log(result);
    125      }
    126    );
     127   console.log(this.categoryIds);
     128   
     129   if(this.cityOption){
     130    this.locationService.getLocationsFromCity(this.cityId, this.companionId, this.lengthOfStay, this.categoryIds).subscribe(
     131      result => {
     132        console.log(result);
     133      }
     134    );
     135   }else if(this.regionOption){
     136 
     137    this.locationService.getLocationsFromRegion(this.regionId, this.companionId, this.lengthOfStay, this.categoryIds).subscribe(
     138      result => {
     139        console.log(result);
     140      }
     141    );
     142   }
     143   
     144 
    127145 }
    128146 chooseCityOption(){
     
    134152    this.cityOption = false;
    135153  }
     154
     155  constraintMaxNumberDays(){
     156     if(this.value > this.max){
     157       this.value = this.max;
     158     }
     159  }
    136160}
Note: See TracChangeset for help on using the changeset viewer.