improve create event from chat

This commit is contained in:
Peter Maquiran
2022-08-01 16:20:26 +01:00
parent e78de0e193
commit 75795d9628
3 changed files with 19 additions and 2 deletions
@@ -488,10 +488,12 @@ export class NewEventPage implements OnInit {
else if(this.loggeduser.Profile == 'PR') {
const CalendarId = this.selectedCalendarId()
let loader = this.toastService.loading();
this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe(
(id) => {
loader.remove()
const eventId: any = id;
@@ -520,6 +522,10 @@ export class NewEventPage implements OnInit {
this.afterSave();
}
this.toastService._successMessage('Evento criado')
},()=>{
loader.remove()
this.showLoader = false
this.toastService._badRequest('Evento não criado')
});
} else {
@@ -527,10 +533,12 @@ export class NewEventPage implements OnInit {
const CalendarId = this.selectedCalendarId()
let loader = this.toastService.loading();
this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe(
(id) => {
loader.remove();
const eventId: any = id;
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
@@ -558,6 +566,10 @@ export class NewEventPage implements OnInit {
this.afterSave();
}
this.toastService._successMessage('Evento criado')
},()=>{
loader.remove()
this.showLoader = false
this.toastService._badRequest('Evento não criado')
});
}
@@ -643,7 +655,7 @@ export class NewEventPage implements OnInit {
return true;
} else {
return false;
}
}