Improve edit event to approve

This commit is contained in:
Peter Maquiran
2021-05-19 11:36:21 +01:00
parent 371cedfd76
commit 5274695a43
3 changed files with 5 additions and 3 deletions
@@ -19,7 +19,7 @@ import { Event, EventToApproveEdit } from '../../../models/event.model';
export class EditEventToApproveComponent implements OnInit {
serialNumber: string
loadedAttachments: Attachment[]
loadedAttachments: Attachment[]= []
eventProcess = {
@@ -258,8 +258,10 @@ export class EditEventToApproveComponent implements OnInit {
this.loadedAttachments.forEach((document:any)=>{
if(document['action'] == 'add'){
delete document.action
this.attachmentsService.setEventAttachmentById(document).subscribe(()=>{});
} else if(document['action'] == 'delete') {
delete document.action
this.attachmentsService.deleteEventAttachmentById(document).subscribe( res=>{})
}
@@ -382,6 +384,7 @@ export class EditEventToApproveComponent implements OnInit {
this.loadedAttachments.push(DocumentToSave)
console.log('push', DocumentToSave)
// await this.attachmentsService.setEventAttachmentById(DocumentToSave).subscribe(()=>{
// this.getAttachments();