This commit is contained in:
tiago.kayaya
2021-06-15 17:42:51 +01:00
parent 1682d63a42
commit b9d4e2dc95
9 changed files with 239 additions and 232 deletions
+14 -11
View File
@@ -75,10 +75,11 @@ export class HomePage implements OnInit {
}
ngOnInit() {
this.count();
//Add a test
//this.pushCordova();
//Initialize profile as mdgpr
}
async count(){
let date = new Date();
date.setMonth(date.getMonth() + 1);
@@ -87,16 +88,18 @@ export class HomePage implements OnInit {
this.profile = "mdgpr";
if (this.profile == "mdgpr") {
this.eventService.getAllMdEvents(start, end).subscribe(res => {
this.eventsList = res;
this.totalEvent = this.eventsList.length;
});
let mdOficialEvents = await this.eventService.getAllPrOficialEvents(start, end).toPromise();
let mdPessoalEvents = await this.eventService.getAllPrPessoalEvents(start, end).toPromise();
this.eventsList = mdOficialEvents.concat(mdPessoalEvents)
this.totalEvent = this.eventsList.length;
}
else {
this.eventService.getAllPrEvents(start, end).subscribe(res => {
this.eventsList = res;
this.totalEvent = this.eventsList.length;
});
let prOficialEvents = await this.eventService.getAllPrOficialEvents(start, end).toPromise();
let prPessoalEvents = await this.eventService.getAllPrPessoalEvents(start, end).toPromise();
this.eventsList = prOficialEvents.concat(prPessoalEvents)
this.totalEvent = this.eventsList.length;
}