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.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 {
const id: any = e.Id
const remove = e['remove']
for( let e of this.loadedEventAttachments) {
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: '',
};
this.attachmentsService.setEventAttachmentById(DocumentToSave).subscribe(()=>{
this.getAttachments(this.postEvent.EventId);
});
await this.attachmentsService.setEventAttachmentById(DocumentToSave).toPromise();
} 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
});
}
@@ -357,6 +357,7 @@ export class ViewEventPage implements OnInit {
this.loadEvent()
}, 250);
this.isEventEdited = true;
console.log('res', res)
}
});
@@ -391,6 +392,12 @@ export class ViewEventPage implements OnInit {
}, 250);
this.isEventEdited = true;
if(res.data.Attendees?.length >= 1) {
this.loadedEvent.HasAttachments = true
this.getAttachments()
}
console.log('res', res)
}
this.getAttachments()
@@ -366,32 +366,34 @@ export class EditEventPage implements OnInit {
async saveDocument() {
await this.loadedEventAttachments.forEach( async (e)=>{
try {
const id: any = e.Id
const remove = e['remove']
for( let e of this.loadedEventAttachments) {
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.getAttachments(this.postEvent.EventId);
await this.attachmentsService.setEventAttachmentById(DocumentToSave).toPromise();
} else if(remove) {
await this.attachmentsService.deleteEventAttachmentById(e.Id).toPromise()
} else if(remove) {
await this.attachmentsService.deleteEventAttachmentById(e.Id).toPromise()
}
}
} catch (error) {
})
}
}
+6 -6
View File
@@ -1,12 +1,12 @@
export let versionData = {
"shortSHA": "1e568d096",
"SHA": "1e568d096a95af07afb280bc94c6d39af8801645",
"shortSHA": "5db8d1f1e",
"SHA": "5db8d1f1e5f331786c945afede5631996bbc095a",
"branch": "feature/gabinete-search",
"lastCommitAuthor": "'Peter Maquiran'",
"lastCommitTime": "'Tue Jun 13 10:53:59 2023 +0100'",
"lastCommitMessage": "fix route",
"lastCommitNumber": "5009",
"lastCommitTime": "'Tue Jun 13 11:31:59 2023 +0100'",
"lastCommitMessage": "tab organization",
"lastCommitNumber": "5010",
"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"
}