Improve add attachment

This commit is contained in:
Peter Maquiran
2021-04-20 15:05:40 +01:00
parent e794c12872
commit ecb87959a0
9 changed files with 86 additions and 24 deletions
@@ -62,8 +62,6 @@ export class EditEventComponent implements OnInit {
}
}
}
// attendees list
if(this.postEvent.Attendees != null) {
@@ -186,7 +184,17 @@ export class EditEventComponent implements OnInit {
getAttachments(eventId: string){
this.attachmentsService.getAttachmentsById(eventId).subscribe(res=>{
this.loadedEventAttachments = res;
console.log('res', res);
});
}
deleteAttachment(attachmentID: string) {
this.attachmentsService.deleteEventAttachmentById(attachmentID).subscribe(
res=>{
this.loadedEventAttachments = this.loadedEventAttachments.filter(e=> e.Id.toString() != attachmentID);
})
}
}