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
@@ -157,7 +157,7 @@
<div class="ion-icon-class"> <div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-refresh.svg"></ion-icon> <ion-icon slot="start" src="assets/images/icons-refresh.svg"></ion-icon>
</div> </div>
<div class="ion-input-class" [class.input-error]="Form?.get('Categories')?.invalid && validateFrom "> <div class="ion-input-class">
<ion-select placeholder="Selecione a repetição*" <ion-select placeholder="Selecione a repetição*"
[(ngModel)]="selectedRecurringType" [(ngModel)]="selectedRecurringType"
(ngModelChange)="onSelectedRecurringChanged($event)" (ngModelChange)="onSelectedRecurringChanged($event)"
@@ -46,8 +46,6 @@ export class EditEventPage implements OnInit {
adding: "intervenient" | "CC" = "intervenient"; adding: "intervenient" | "CC" = "intervenient";
showAttendees = false; showAttendees = false;
constructor( constructor(
@@ -168,7 +166,7 @@ export class EditEventPage implements OnInit {
IsRecurring: new FormControl(this.postEvent.IsRecurring, [ IsRecurring: new FormControl(this.postEvent.IsRecurring, [
Validators.required 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 Validators.required
]), ]),
@@ -191,8 +189,7 @@ export class EditEventPage implements OnInit {
} }
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc) 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 () => { this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => {
@@ -204,6 +201,9 @@ export class EditEventPage implements OnInit {
try { try {
await this.eventsService.changeAgenda(body).toPromise(); await this.eventsService.changeAgenda(body).toPromise();
} catch (error) {} } catch (error) {}
finally {
this.goBack();
}
} }
this.toastService.successMessage(); this.toastService.successMessage();
@@ -213,12 +213,9 @@ export class EditEventPage implements OnInit {
}); });
this.isEventEdited = true; this.isEventEdited = true;
this.goBack();
this.modalController.dismiss(this.isEventEdited); this.modalController.dismiss(this.isEventEdited);
} catch (error) {
this.toastService.badRequest()
}
this.saveDocument() this.saveDocument()
} }
@@ -251,7 +251,7 @@ export class NewEventPage implements OnInit {
participantes: new FormControl(this.taskParticipants, [ participantes: new FormControl(this.taskParticipants, [
Validators.required Validators.required
]), ]),
Date: new FormControl(this.postEvent.StartDate.toLocaleString() < this.postEvent.EndDate.toLocaleString() ? 'ok': null,[ Date: new FormControl(this.postEvent.StartDate.getTime() < this.postEvent.EndDate.getTime() ? 'ok': null,[
Validators.required Validators.required
]), ]),