mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
fix
This commit is contained in:
@@ -366,32 +366,34 @@ export class EditEventPage implements OnInit {
|
||||
async saveDocument() {
|
||||
|
||||
|
||||
await this.loadedEventAttachments.forEach( async (e)=>{
|
||||
try {
|
||||
|
||||
for( let e of this.loadedEventAttachments) {
|
||||
const id: any = e.Id
|
||||
const remove = e['remove']
|
||||
|
||||
const id: any = e.Id
|
||||
const remove = e['remove']
|
||||
if ( id == 'add') {
|
||||
//data.selected
|
||||
const DocumentToSave = {
|
||||
SourceTitle: e.SourceName,
|
||||
ParentId: this.postEvent.EventId,
|
||||
Source: '1',
|
||||
SourceId: e.SourceId,
|
||||
ApplicationId: e.ApplicationId.toString(),
|
||||
Id: '0',
|
||||
Link: '',
|
||||
SerialNumber: '',
|
||||
};
|
||||
|
||||
if ( id == 'add') {
|
||||
//data.selected
|
||||
const DocumentToSave = {
|
||||
SourceTitle: e.SourceName,
|
||||
ParentId: this.postEvent.EventId,
|
||||
Source: '1',
|
||||
SourceId: e.SourceId,
|
||||
ApplicationId: e.ApplicationId.toString(),
|
||||
Id: '0',
|
||||
Link: '',
|
||||
SerialNumber: '',
|
||||
};
|
||||
await this.attachmentsService.setEventAttachmentById(DocumentToSave).toPromise();
|
||||
|
||||
await this.attachmentsService.setEventAttachmentById(DocumentToSave).toPromise();
|
||||
await this.getAttachments(this.postEvent.EventId);
|
||||
|
||||
} else if(remove) {
|
||||
await this.attachmentsService.deleteEventAttachmentById(e.Id).toPromise()
|
||||
} else if(remove) {
|
||||
await this.attachmentsService.deleteEventAttachmentById(e.Id).toPromise()
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user