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
@@ -191,7 +191,7 @@
<div class="d-flex container-div width-100" >
<ion-list class="width-100 ">
<ion-item class="width-100" *ngFor="let document of loadedAttachments">
<ion-label class="width-100 d-block list">
<ion-label class="width-100 d-block list" *ngIf="document.action != 'delete' ">
<p class="d-flex ion-justify-content-between">
<span class="attach-title-item">{{document.SourceName}}</span>
<span class="app-name" *ngIf="document.ApplicationId == 8"> Correspondencia </span>
@@ -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();
// });
}
});
}