This commit is contained in:
2022-04-02 14:51:57 +01:00
parent fa25462897
commit 5570b07ddf
7 changed files with 148 additions and 94 deletions
@@ -99,13 +99,6 @@ export class ViewEventPage implements OnInit {
}
});
/* this.activatedRoute.queryParams.subscribe(params => {
if(params["eventId"]) {
this.eventId = params["eventId"];
console.log(params["eventId"]);
}
}); */
}
ngOnInit() {
@@ -248,24 +241,46 @@ export class ViewEventPage implements OnInit {
const loader = this.toastService.loading()
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () => {
const alert = await this.alertController.create({
cssClass: 'my-custom-class',
header: 'Evento removido',
buttons: ['OK']
});
setTimeout(() => {
alert.dismiss();
}, 1500);
this.goBack();
this.toastService.successMessage('Evento apagado');
}, () => { },
() => {
loader.remove();
});
loader.remove();
if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () => {
const alert = await this.alertController.create({
cssClass: 'my-custom-class',
header: 'Evento removido',
buttons: ['OK']
});
setTimeout(() => {
alert.dismiss();
}, 1500);
this.goBack();
this.toastService.successMessage('Evento apagado');
}, () => { },
() => {
loader.remove();
});
} else {
this.eventsService.genericDeleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName, this.loadedEvent.CalendarId).subscribe(async () => {
const alert = await this.alertController.create({
cssClass: 'my-custom-class',
header: 'Evento removido',
buttons: ['OK']
});
setTimeout(() => {
alert.dismiss();
}, 1500);
this.goBack();
this.toastService.successMessage('Evento apagado');
}, () => { },
() => {
loader.remove();
});
}
}