This commit is contained in:
Peter Maquiran
2021-07-16 23:16:55 +01:00
parent fe0485fb0d
commit 2cb0d9fda7
3 changed files with 27 additions and 30 deletions
@@ -46,8 +46,6 @@ export class EditEventPage implements OnInit {
adding: "intervenient" | "CC" = "intervenient";
showAttendees = false;
constructor(
@@ -168,7 +166,7 @@ export class EditEventPage implements OnInit {
IsRecurring: new FormControl(this.postEvent.IsRecurring, [
Validators.required
]),
Date: new FormControl(new Date(this.postEvent.StartDate).toLocaleString() < new Date(this.postEvent.EndDate).toLocaleString()? 'ok': null,[
Date: new FormControl(new Date(this.postEvent.StartDate).getTime() < new Date(this.postEvent.EndDate).getTime()? 'ok': null,[
Validators.required
]),
@@ -191,34 +189,33 @@ export class EditEventPage implements OnInit {
}
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc)
try{
console.log(this.postEvent);
this.postEvent.EventRecurrence.Type = this.selectedRecurringType;
this.postEvent.EventRecurrence.Type = this.selectedRecurringType;
this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => {
if(this.initCalendarName != this.postEvent.CalendarName){
let body = {
"EventId": this.postEvent.EventId,
"CalendarDestinationName": this.postEvent.CalendarName,
}
try {
await this.eventsService.changeAgenda(body).toPromise();
} catch (error) {}
this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => {
if(this.initCalendarName != this.postEvent.CalendarName){
let body = {
"EventId": this.postEvent.EventId,
"CalendarDestinationName": this.postEvent.CalendarName,
}
try {
await this.eventsService.changeAgenda(body).toPromise();
} catch (error) {}
finally {
this.goBack();
}
}
this.toastService.successMessage();
}
this.toastService.successMessage();
}, error => {
this.toastService.badRequest()
});
this.isEventEdited = true;
this.goBack();
this.modalController.dismiss(this.isEventEdited);
} catch (error) {
}, error => {
this.toastService.badRequest()
}
});
this.isEventEdited = true;
this.modalController.dismiss(this.isEventEdited);
this.saveDocument()
}