This commit is contained in:
tiago.kayaya
2021-09-15 13:38:14 +01:00
parent f0e6a8a32d
commit db851e95dd
5 changed files with 128 additions and 80 deletions
@@ -86,8 +86,9 @@ export class DocumentSetUpMeetingPage implements OnInit {
emptyTextDescription = "Sem intervenientes selecionados";
document: SearchFolderDetails | SearchDocumentDetails | any;
subject: string
subject: string;
docs:any[] = [];
eventPipe = new EventPipe()
constructor(
@@ -178,8 +179,8 @@ export class DocumentSetUpMeetingPage implements OnInit {
var Attachments: addAttachment[] = []
let folder: SearchFolderDetails = this.document
let document: SearchDocumentDetails = this.document
if(folder.Documents) {
/* if(folder.Documents) {
this.document.Documents.forEach( (_folder: SearchFolderDetailsDocuments) => {
Attachments.push({
ApplicationId: 361,
@@ -204,8 +205,18 @@ export class DocumentSetUpMeetingPage implements OnInit {
SourceId: e.Id,
SourceTitle: e.Assunto
})
}) */
this.document.Documents.forEach((e)=> {
this.docs.push({
ApplicationId: e.ApplicationId || e.ApplicationType,
Source: 1,
SourceId: e.DocId || e.docID || e.docId,
SourceName: e.Assunto
})
})
console.log(this.docs);
let postEvent = {
EventId: '',
@@ -229,25 +240,32 @@ export class DocumentSetUpMeetingPage implements OnInit {
Type: this.EventRecurrenceType,
LastOccurrence: this.Occurrence
},
Attachments: this.docs, /* [
{
"Source": 1,
"SourceId": 121367,
"SourceName": "sample string 5",
"ApplicationId": 8
}
], */
}
console.log(postEvent);
const laoder = this.toastService.loading()
this.eventService.create({
body: postEvent,
calendar: this.postData.CalendarName
}).subscribe(async (respose) => {
this.eventService.create({ body: postEvent, calendar: this.postData.CalendarName }).subscribe(async (respose) => {
const res: any = respose;
const eventId: string = res
const DocumentToSave = this.attachments.map((e) => {
/* const DocumentToSave = this.attachments.map((e) => {
return this.eventPipe.AttactSearchResult(e, eventId, {})
});
await DocumentToSave.forEach(async (attachments, i) => {
await this.eventService.addAttachment(attachments).toPromise();
});
}); */
laoder.remove()
this.modalController.dismiss()