This commit is contained in:
Peter Maquiran
2022-04-02 09:40:09 +01:00
parent 53c59e7a43
commit e69392ce58
19 changed files with 786 additions and 213 deletions
@@ -448,6 +448,39 @@ export class NewEventPage implements OnInit {
}
this.toastService.successMessage('Evento criado')
});
} else {
this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName).subscribe(
(id) => {
console.log(id);
const eventId: any = id;
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
return {
SourceTitle: e.Assunto,
ParentId: eventId,
Source: '1',
SourceId: e.Id,
ApplicationId: e.ApplicationType.toString(),
Id: '',
Link: '',
SerialNumber: ''
};
});
DocumentToSave.forEach((attachments, i) => {
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) =>{
if(DocumentToSave.length == (i+1)){
this.afterSave();
}
});
});
if(DocumentToSave.length == 0){
this.afterSave();
}
this.toastService.successMessage('Evento criado')
});
}
}