diff --git a/src/app/pages/agenda/edit-event/edit-event.page.ts b/src/app/pages/agenda/edit-event/edit-event.page.ts index 2a2344f09..7111e01c6 100644 --- a/src/app/pages/agenda/edit-event/edit-event.page.ts +++ b/src/app/pages/agenda/edit-event/edit-event.page.ts @@ -200,9 +200,11 @@ export class EditEventPage implements OnInit { let body = { "EventId": this.postEvent.EventId, "CalendarDestinationName": this.postEvent.CalendarName, - } - console.log(body); + } + try { await this.eventsService.changeAgenda(body).toPromise(); + } catch (error) {} + } this.toastService.successMessage(); diff --git a/src/app/shared/agenda/edit-event/edit-event.page.html b/src/app/shared/agenda/edit-event/edit-event.page.html index f7e2a5a2c..ac92d52b0 100644 --- a/src/app/shared/agenda/edit-event/edit-event.page.html +++ b/src/app/shared/agenda/edit-event/edit-event.page.html @@ -173,7 +173,7 @@ { - this.selectedRecurringType = this.postEvent.EventRecurrence.Type.toString(); - console.log(this.selectedRecurringType); + this.postEvent.EventRecurrence.Type = this.postEvent.EventRecurrence.Type.toString(); + console.log( this.postEvent.EventRecurrence.Type); }, 1000); @@ -177,17 +175,6 @@ export class EditEventPage implements OnInit { }); } - onSelectedRecurringChanged(ev:any){ - console.log(ev); - if(ev.length > 1){ - console.log(ev.filter(data => data != '-1')); - this.selectedRecurringType = ev.filter(data => data != '-1'); - } - if(ev.length == 0){ - this.selectedRecurringType = "-1"; - } - } - runValidation() { this.validateFrom = true @@ -248,6 +235,17 @@ export class EditEventPage implements OnInit { } } + onSelectedRecurringChanged(ev:any){ + console.log(ev); + if(ev.length > 1){ + console.log(ev.filter(data => data != '-1')); + this.postEvent.EventRecurrence.Type = ev.filter(data => data != '-1'); + } + if(ev.length == 0){ + this.postEvent.EventRecurrence.Type = "-1"; + } + } + async save() { @@ -257,9 +255,6 @@ export class EditEventPage implements OnInit { if(this.Form.invalid) { return false } - if(this.selectedRecurringType != '-1'){ - this.postEvent.EventRecurrence.Type = this.selectedRecurringType; - } this.getDatepickerData() this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc); @@ -273,12 +268,9 @@ export class EditEventPage implements OnInit { "CalendarDestinationName": this.postEvent.CalendarName, } - console.log(body); - try { await this.eventsService.changeAgenda(body).toPromise(); } catch (e) {} - } this.showLoader = false; this.toastService.successMessage()