diff --git a/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.html b/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.html index 9641ce6ff..d5040e88f 100644 --- a/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.html +++ b/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.html @@ -191,7 +191,7 @@
{{document.SourceName}} Correspondencia diff --git a/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts b/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts index e9a729e0f..f7a47258b 100644 --- a/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts +++ b/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts @@ -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(); // }); - } }); }