Improve attendess

This commit is contained in:
Peter Maquiran
2021-04-08 13:39:48 +01:00
parent 2b60d175c7
commit afc4f68cdd
9 changed files with 99 additions and 63 deletions
@@ -44,17 +44,20 @@ export class EditEventPage implements OnInit {
this.postEvent.Body.Text = this.postEvent.Body.Text.replace(/<[^>]+>/g, '');
}
this.taskParticipants = [];
this.taskParticipantsCc = [];
if(this.postEvent.Attendees == null){
this.taskParticipants = []
} else {
this.taskParticipants = this.postEvent.Attendees;
this.postEvent.Attendees.forEach(e =>{
if(e.IsRequired){
this.taskParticipants.push(e);
} else {
this.taskParticipantsCc.push(e);
}
})
}
this.taskParticipantsCc = [];
if(this.postEvent.IsRecurring == false){
this.isRecurring = "Não se repete";
}
@@ -80,7 +83,9 @@ export class EditEventPage implements OnInit {
}
save(){
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc)
this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => {
const alert = await this.alertController.create({
cssClass: 'my-custom-class',
@@ -122,7 +127,6 @@ export class EditEventPage implements OnInit {
}
});
}
}
setIntervenient(data){
@@ -145,4 +149,10 @@ export class EditEventPage implements OnInit {
this.openAttendees();
}
dynamicSetIntervenient({taskParticipants, taskParticipantsCc}){
this.taskParticipants = taskParticipants;
this.taskParticipantsCc = taskParticipantsCc;
}
}