This commit is contained in:
Peter Maquiran
2023-06-13 12:27:27 +01:00
parent 5db8d1f1e5
commit fced941d55
4 changed files with 70 additions and 55 deletions
@@ -313,7 +313,7 @@ export class EditEventPage implements OnInit {
} }
save() { async save() {
this.injectValidation() this.injectValidation()
this.runValidation() this.runValidation()
@@ -340,7 +340,6 @@ export class EditEventPage implements OnInit {
await this.eventsService.changeAgenda(body).toPromise(); await this.eventsService.changeAgenda(body).toPromise();
} catch (error) {} } catch (error) {}
finally { finally {
this.goBack();
} }
} }
@@ -363,7 +362,6 @@ export class EditEventPage implements OnInit {
await this.eventsService.changeAgenda(body).toPromise(); await this.eventsService.changeAgenda(body).toPromise();
} catch (error) {} } catch (error) {}
finally { finally {
this.goBack();
} }
} }
@@ -379,42 +377,50 @@ export class EditEventPage implements OnInit {
this.isEventEdited = true; this.isEventEdited = true;
this.modalController.dismiss(this.isEventEdited);
await this.saveDocument()
this.saveDocument() this.goBack();
} }
saveDocument() { async saveDocument() {
this.loadedEventAttachments.forEach((e) => { try {
const id: any = e.Id for( let e of this.loadedEventAttachments) {
const remove = e['remove'] const id: any = e.Id
const remove = e['remove']
if ( id == 'add') { if ( id == 'add') {
//data.selected //data.selected
const DocumentToSave = { const DocumentToSave = {
SourceTitle: e.SourceName, SourceTitle: e.SourceName,
ParentId: this.postEvent.EventId, ParentId: this.postEvent.EventId,
Source: '1', Source: '1',
SourceId: e.SourceId, SourceId: e.SourceId,
ApplicationId: e.ApplicationId.toString(), ApplicationId: e.ApplicationId.toString(),
Id: '0', Id: '0',
Link: '', Link: '',
SerialNumber: '', SerialNumber: '',
}; };
this.attachmentsService.setEventAttachmentById(DocumentToSave).subscribe(()=>{ await this.attachmentsService.setEventAttachmentById(DocumentToSave).toPromise();
this.getAttachments(this.postEvent.EventId);
});
} else if(remove) { } else if(remove) {
this.attachmentsService.deleteEventAttachmentById(e.Id).subscribe( res=> {}) await this.attachmentsService.deleteEventAttachmentById(e.Id).toPromise()
}
} }
} catch (error) {
}) } finally {
}
this.modalController.dismiss({
isEventEdited: this.isEventEdited,
postEvent: this.postEvent
});
} }
@@ -357,6 +357,7 @@ export class ViewEventPage implements OnInit {
this.loadEvent() this.loadEvent()
}, 250); }, 250);
this.isEventEdited = true; this.isEventEdited = true;
console.log('res', res)
} }
}); });
@@ -391,6 +392,12 @@ export class ViewEventPage implements OnInit {
}, 250); }, 250);
this.isEventEdited = true; this.isEventEdited = true;
if(res.data.Attendees?.length >= 1) {
this.loadedEvent.HasAttachments = true
this.getAttachments()
}
console.log('res', res)
} }
this.getAttachments() this.getAttachments()
@@ -366,32 +366,34 @@ export class EditEventPage implements OnInit {
async saveDocument() { async saveDocument() {
await this.loadedEventAttachments.forEach( async (e)=>{ try {
const id: any = e.Id for( let e of this.loadedEventAttachments) {
const remove = e['remove'] const id: any = e.Id
const remove = e['remove']
if ( id == 'add') { if ( id == 'add') {
//data.selected //data.selected
const DocumentToSave = { const DocumentToSave = {
SourceTitle: e.SourceName, SourceTitle: e.SourceName,
ParentId: this.postEvent.EventId, ParentId: this.postEvent.EventId,
Source: '1', Source: '1',
SourceId: e.SourceId, SourceId: e.SourceId,
ApplicationId: e.ApplicationId.toString(), ApplicationId: e.ApplicationId.toString(),
Id: '0', Id: '0',
Link: '', Link: '',
SerialNumber: '', SerialNumber: '',
}; };
await this.attachmentsService.setEventAttachmentById(DocumentToSave).toPromise(); await this.attachmentsService.setEventAttachmentById(DocumentToSave).toPromise();
await this.getAttachments(this.postEvent.EventId);
} else if(remove) { } else if(remove) {
await this.attachmentsService.deleteEventAttachmentById(e.Id).toPromise() await this.attachmentsService.deleteEventAttachmentById(e.Id).toPromise()
}
} }
} catch (error) {
}) }
} }
+6 -6
View File
@@ -1,12 +1,12 @@
export let versionData = { export let versionData = {
"shortSHA": "1e568d096", "shortSHA": "5db8d1f1e",
"SHA": "1e568d096a95af07afb280bc94c6d39af8801645", "SHA": "5db8d1f1e5f331786c945afede5631996bbc095a",
"branch": "feature/gabinete-search", "branch": "feature/gabinete-search",
"lastCommitAuthor": "'Peter Maquiran'", "lastCommitAuthor": "'Peter Maquiran'",
"lastCommitTime": "'Tue Jun 13 10:53:59 2023 +0100'", "lastCommitTime": "'Tue Jun 13 11:31:59 2023 +0100'",
"lastCommitMessage": "fix route", "lastCommitMessage": "tab organization",
"lastCommitNumber": "5009", "lastCommitNumber": "5010",
"change": "", "change": "",
"changeStatus": "On branch feature/gabinete-search\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/pages/gabinete-digital/event-list/event-list.page.html\n\tmodified: src/app/pages/gabinete-digital/event-list/event-list.page.ts\n\tmodified: src/app/services/events.service.ts\n\tmodified: src/app/shared/agenda/event-list/event-list.page.html\n\tmodified: src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.html\n\tmodified: src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.ts", "changeStatus": "On branch feature/gabinete-search\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/pages/agenda/edit-event/edit-event.page.ts\n\tmodified: src/app/pages/agenda/view-event/view-event.page.ts\n\tmodified: src/app/shared/agenda/edit-event/edit-event.page.ts",
"changeAuthor": "peter.maquiran" "changeAuthor": "peter.maquiran"
} }