main
manueltauber 2023-06-20 13:18:29 +02:00
parent bb924bd10f
commit 9edb886ce7
2 changed files with 6 additions and 4 deletions

View File

@ -202,14 +202,16 @@ export class DataService {
public async fetchPlanTimes(filters: any, renderStartDate: Date, renderEndtDate: Date){ public async fetchPlanTimes(filters: any, renderStartDate: Date, renderEndtDate: Date){
const promise = new Promise(resolve=>{ 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 stringyfiedData = JSON.stringify(obj);
let dataJson = JSON.parse(stringyfiedData) as typeof stringyfiedData; let dataJson = JSON.parse(stringyfiedData) as typeof stringyfiedData;
console.log(dataJson); console.log(dataJson);
let res : any[] = []; let res : any[] = [];
this.http.post('http://localhost:8080/api/fetchPlanTimes', dataJson) this.http.post('http://localhost:8080/api/fetchPlanTimes', dataJson)
.subscribe((response: any)=>{ .subscribe((response: any[])=>{
console.log(response); response.forEach(week => {
res.push(week);
});
resolve(res); resolve(res);
}) })
}) })

View File

@ -274,7 +274,7 @@ public logg(args){
this.inputForTimeline = [this.splitterSettings, this.projectStartDate, this.projectEndDate]; this.inputForTimeline = [this.splitterSettings, this.projectStartDate, this.projectEndDate];
}); });
}); });
this.dataService.fetchPlanTimes({'filterElement': this.filters}, this.projectStartDate, this.projectEndDate);