From 11334b99fec10b7d9d1f53efcdd4572ad292396e Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Fri, 21 May 2021 11:07:28 +0100 Subject: [PATCH] Improve segment for agenda --- src/app/pages/agenda/agenda.page.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/pages/agenda/agenda.page.ts b/src/app/pages/agenda/agenda.page.ts index 2ad63d637..ec8554e9f 100644 --- a/src/app/pages/agenda/agenda.page.ts +++ b/src/app/pages/agenda/agenda.page.ts @@ -538,8 +538,8 @@ export class AgendaPage implements OnInit { //this.eventSource=[]; - if(this.loggeduser.Profile == 'MDGPR' ) { - this.eventService.getAllMdEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).subscribe( + if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR' ) { + this.eventService.getAllMdEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).subscribe( response => { // calendar @@ -576,7 +576,7 @@ export class AgendaPage implements OnInit { this.timelineBoxCorrectHeight(500); this.centralizeTimeline(500); - }); + }); } else { @@ -627,7 +627,7 @@ export class AgendaPage implements OnInit { case "Pessoal": //Inicializa o array eventSource - if(this.loggeduser.Profile == 'MDGPR') { + if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR') { this.eventService.getAllMdEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(response => { this.eventSource=[]; @@ -703,7 +703,7 @@ export class AgendaPage implements OnInit { //Inicializa o array eventSource this.eventsListOficial = []; - if(this.loggeduser.Profile == 'MDGPR') { + if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR') { this.eventService.getAllMdEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(res => { this.eventSource=[]; this.eventsListOficial = res.filter(data => data.CalendarName == "Oficial");