change events agenda

This commit is contained in:
tiago.kayaya
2021-06-29 10:50:05 +01:00
parent 46e6e3fe88
commit a5be718a14
5 changed files with 57 additions and 37 deletions
@@ -25,6 +25,7 @@ export class EditEventPage implements OnInit {
isRecurring:string;
isEventEdited: boolean;
loadedEvent: Event;
initCalendarName: string;
eventBody: EventBody;
segment:string = "true";
eventAttendees: EventPerson[];
@@ -157,19 +158,16 @@ export class EditEventPage implements OnInit {
this.showLoader = true
await this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => {
this.showLoader = false
const alert = await this.alertController.create({
cssClass: 'my-custom-class',
header: 'Evento actualizado',
buttons: ['OK']
});
if(this.initCalendarName != this.postEvent.CalendarName){
let body = {
"EventId": this.postEvent.EventId,
"CalendarDestinationName": this.postEvent.CalendarName,
}
console.log(body);
await this.eventsService.changeAgenda(body).toPromise();
}
this.showLoader = false;
this.toastService.successMessage()
setTimeout(()=>{
alert.dismiss();
}, 1500);
},
error => {
this.showLoader = false