fix eventos

This commit is contained in:
Peter Maquiran
2023-02-22 10:08:50 +01:00
parent f9bc1ae153
commit 9c540d38b0
4 changed files with 58 additions and 6 deletions
@@ -7,6 +7,7 @@ import { LoginUserRespose } from 'src/app/models/user.model';
import { SortService } from 'src/app/services/functions/sort.service';
import { SessionStore } from 'src/app/store/session.service';
import { EventsService } from 'src/app/services/events.service';
import { EventoAprovacaoStore } from 'src/app/store/eventoaprovacao-store.service';
@Component({
selector: 'app-event-list',
@@ -26,6 +27,7 @@ export class EventListPage implements OnInit {
serialnumber:string;
loggeduser: LoginUserRespose;
segment:string;
eventoaprovacaostore = EventoAprovacaoStore;
@Input() profile:string;
@Input() showComponent:string;
@@ -79,6 +81,7 @@ export class EventListPage implements OnInit {
try {
if(this.segment == 'MDGPR') {
const segment = this.segment
let mdEventsOficial = await this.processes.GetTasksList('Agenda Oficial MDGPR', false).toPromise();
let mdEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal MDGPR', false).toPromise();
@@ -87,8 +90,11 @@ export class EventListPage implements OnInit {
this.eventsMDGPRList = this.sortService.sortArrayByDate(allEvents).reverse();
}
this.showLoader = false;
this.eventoaprovacaostore.save(segment, this.eventsMDGPRList)
}
else if(this.segment == 'PR') {
const segment = this.segment
let prEventsOficial = await this.processes.GetTasksList('Agenda Oficial PR,Agenda Pessoal PR', false).toPromise();
let allEvents = prEventsOficial
@@ -96,6 +102,8 @@ export class EventListPage implements OnInit {
this.eventsPRList = this.sortService.sortArrayByDate(allEvents).reverse();
}
this.showLoader = false;
this.eventoaprovacaostore.save(segment, this.eventsMDGPRList)
} else {
let genericEvents = await this.processes.GetTasksList('Agendar Evento', false).toPromise();
if(genericEvents.length > 0) {