Improve event to approve

This commit is contained in:
Peter Maquiran
2021-05-14 15:21:59 +01:00
parent e0a91ddbd1
commit 5fc865637a
2 changed files with 13 additions and 14 deletions
@@ -220,11 +220,6 @@ export class EditEventToApproveComponent implements OnInit {
save() {
this.taskParticipantsCc.forEach(e => {
e.is
});
this.taskParticipantsCc.forEach(e=>{
e.IsRequired = false
})
@@ -252,6 +247,16 @@ export class EditEventToApproveComponent implements OnInit {
this.eventsService.postEventToApproveEdit(event).subscribe()
this.loadedAttachments.forEach((document:any)=>{
if(document['action'] == 'add'){
this.attachmentsService.setEventAttachmentById(document).subscribe(()=>{});
} else if(document['action'] == 'delete') {
this.attachmentsService.deleteEventAttachmentById(document).subscribe( res=>{})
}
})
alert('save')
}
@@ -328,14 +333,9 @@ export class EditEventToApproveComponent implements OnInit {
console.log('this.loadedAttachments', this.loadedAttachments, result)
}
deleteAttachment(attachmentID) {
deleteAttachment(attachment: Attachment) {
const AttachmentToDelete = this.loadedAttachments.filter(e => e.Id == attachmentID)[0]
this.attachmentsService.deleteEventAttachmentById(attachmentID).subscribe(
res=>{
this.loadedAttachments = this.loadedAttachments.filter(e=> e.Id.toString() != attachmentID);
})
this.attachmentsService.deleteEventAttachmentById(attachment.Id).subscribe( res=>{})
}
@@ -378,7 +378,6 @@ export class EditEventToApproveComponent implements OnInit {
// await this.attachmentsService.setEventAttachmentById(DocumentToSave).subscribe(()=>{
// this.getAttachments();
// });
}
});
}