diff --git a/frontend/src/app/data.service.ts b/frontend/src/app/data.service.ts index d60cff5..bfac142 100644 --- a/frontend/src/app/data.service.ts +++ b/frontend/src/app/data.service.ts @@ -202,14 +202,16 @@ export class DataService { public async fetchPlanTimes(filters: any, renderStartDate: Date, renderEndtDate: Date){ const promise = new Promise(resolve=>{ - let obj = {filters : filters, renderStartDate : renderStartDate, renderEndDate: renderEndtDate }; + let obj = {filter : filters.filter, renderStartDate : renderStartDate, renderEndDate: renderEndtDate }; let stringyfiedData = JSON.stringify(obj); let dataJson = JSON.parse(stringyfiedData) as typeof stringyfiedData; console.log(dataJson); let res : any[] = []; this.http.post('http://localhost:8080/api/fetchPlanTimes', dataJson) - .subscribe((response: any)=>{ - console.log(response); + .subscribe((response: any[])=>{ + response.forEach(week => { + res.push(week); + }); resolve(res); }) }) diff --git a/frontend/src/ntt-gantt/ntt-gantt.component.ts b/frontend/src/ntt-gantt/ntt-gantt.component.ts index 8a56078..7d8e653 100644 --- a/frontend/src/ntt-gantt/ntt-gantt.component.ts +++ b/frontend/src/ntt-gantt/ntt-gantt.component.ts @@ -274,7 +274,7 @@ public logg(args){ this.inputForTimeline = [this.splitterSettings, this.projectStartDate, this.projectEndDate]; }); }); - this.dataService.fetchPlanTimes({'filterElement': this.filters}, this.projectStartDate, this.projectEndDate); +