mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
fix
This commit is contained in:
@@ -313,7 +313,7 @@ export class EditEventPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
save() {
|
||||
async save() {
|
||||
|
||||
this.injectValidation()
|
||||
this.runValidation()
|
||||
@@ -340,7 +340,6 @@ export class EditEventPage implements OnInit {
|
||||
await this.eventsService.changeAgenda(body).toPromise();
|
||||
} catch (error) {}
|
||||
finally {
|
||||
this.goBack();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -363,7 +362,6 @@ export class EditEventPage implements OnInit {
|
||||
await this.eventsService.changeAgenda(body).toPromise();
|
||||
} catch (error) {}
|
||||
finally {
|
||||
this.goBack();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -379,42 +377,50 @@ export class EditEventPage implements OnInit {
|
||||
|
||||
this.isEventEdited = true;
|
||||
|
||||
this.modalController.dismiss(this.isEventEdited);
|
||||
|
||||
await this.saveDocument()
|
||||
|
||||
this.saveDocument()
|
||||
this.goBack();
|
||||
}
|
||||
|
||||
|
||||
saveDocument() {
|
||||
async saveDocument() {
|
||||
|
||||
this.loadedEventAttachments.forEach((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();
|
||||
|
||||
this.attachmentsService.setEventAttachmentById(DocumentToSave).subscribe(()=>{
|
||||
this.getAttachments(this.postEvent.EventId);
|
||||
});
|
||||
|
||||
} else if(remove) {
|
||||
this.attachmentsService.deleteEventAttachmentById(e.Id).subscribe( res=> {})
|
||||
} else if(remove) {
|
||||
await this.attachmentsService.deleteEventAttachmentById(e.Id).toPromise()
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
})
|
||||
} finally {
|
||||
|
||||
}
|
||||
|
||||
this.modalController.dismiss({
|
||||
isEventEdited: this.isEventEdited,
|
||||
postEvent: this.postEvent
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user