mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
Improve add atendees for agenda
This commit is contained in:
@@ -5,7 +5,7 @@ import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { Event } from 'src/app/models/event.model';
|
||||
import { AlertController } from '@ionic/angular';
|
||||
|
||||
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
|
||||
@Component({
|
||||
selector: 'app-edit-event',
|
||||
templateUrl: './edit-event.component.html',
|
||||
@@ -41,7 +41,7 @@ export class EditEventComponent implements OnInit {
|
||||
private eventsService: EventsService,
|
||||
public alertController: AlertController,
|
||||
) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -52,13 +52,16 @@ export class EditEventComponent implements OnInit {
|
||||
// attendees list
|
||||
if(this.postEvent.Attendees != null) {
|
||||
this.postEvent.Attendees.forEach(e =>{
|
||||
if(e.IsRequired){
|
||||
if(e.IsRequired) {
|
||||
this.taskParticipants.push(e);
|
||||
} else {
|
||||
this.taskParticipantsCc.push(e);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.taskParticipants = removeDuplicate(this.taskParticipants);
|
||||
this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc);
|
||||
|
||||
this.isEventEdited = false;
|
||||
|
||||
@@ -79,7 +82,7 @@ export class EditEventComponent implements OnInit {
|
||||
|
||||
async save(){
|
||||
|
||||
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc)
|
||||
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||
|
||||
await this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => {
|
||||
const alert = await this.alertController.create({
|
||||
|
||||
Reference in New Issue
Block a user