This commit is contained in:
Peter Maquiran
2021-11-07 20:56:34 +01:00
parent c1bdeddb00
commit 585e0989d8
8 changed files with 421 additions and 15 deletions
@@ -142,6 +142,10 @@ export class EditEventPage implements OnInit {
}
ngOnChanges(changes: any): void {
// this.loadedEventAttachments = this.loadedEventAttachments.concat(this.postEvent.Attachments)
}
close() {
this.closeComponent.emit();
this.setIntervenient.emit([]);
@@ -282,7 +286,6 @@ export class EditEventPage implements OnInit {
async saveDocument() {
console.log(this.loadedEventAttachments)
await this.loadedEventAttachments.forEach( async (e)=>{
@@ -303,10 +306,10 @@ export class EditEventPage implements OnInit {
};
await this.attachmentsService.setEventAttachmentById(DocumentToSave).toPromise();
this.getAttachments(this.postEvent.EventId);
await this.getAttachments(this.postEvent.EventId);
} else if(remove) {
this.attachmentsService.deleteEventAttachmentById(e.Id).subscribe( res=> {})
await this.attachmentsService.deleteEventAttachmentById(e.Id).toPromise()
}
})
@@ -365,11 +368,9 @@ export class EditEventPage implements OnInit {
window['temp.path:/home/agenda/edit-event.component.ts'] = {}
}
getAttachments(eventId: string){
this.attachmentsService.getAttachmentsById(eventId).subscribe(res=>{
this.loadedEventAttachments = res;
console.log('res', res);
});
async getAttachments(eventId: string){
const rest: any = this.attachmentsService.getAttachmentsById(eventId).toPromise()
this.loadedEventAttachments = rest;
}
deleteAttachment(attachmentID: string, index) {