mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
save
This commit is contained in:
@@ -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')
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user