fix create event from viewer

This commit is contained in:
Peter Maquiran
2023-10-31 16:26:50 +01:00
parent 185c25a275
commit a6517da1e0
3 changed files with 48 additions and 35 deletions
@@ -117,14 +117,45 @@ export class DocumentSetUpMeetingPage implements OnInit {
this.document = this.navParams.get('document')
if(Array.isArray(this.document)) {
this.attachments = this.document
const E = this.document
this.document = []
E.forEach((e)=> {
this.document.push({
ApplicationId: e.ApplicationId || e.ApplicationType,
Source: 1,
SourceId: e.DocId || e.docID || e.docId || e.SourceId || e.Id,
SourceName: e.Assunto || e.attachments,
DocDate: e.CreateDate,
Data: e.Data,
Assunto: e.Description,
...e
})
})
} else if (this.document) {
const E = this.document
this.document = []
this.document.push({
ApplicationId: E.ApplicationId || E.ApplicationType,
Source: 1,
SourceId: E.DocId || E.docID || E.docId || E.SourceId || E.Id,
SourceName: E.Assunto || E.attachments,
DocDate: E.CreateDate,
Data: E.Data,
Assunto: E.Description,
...E
})
} else {
this.attachments = [this.document]
this.document = []
}
this.document = []
if(Array.isArray(this.document)) {
this.attachments = this.document
} else {
this.attachments = [this.document]
}
this.subject = this.navParams.get('subject')
@@ -277,25 +308,6 @@ export class DocumentSetUpMeetingPage implements OnInit {
let Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
if(this.document.Documents) {
this.document.Documents.forEach((e)=> {
this.docs.push({
ApplicationId: e.ApplicationId || e.ApplicationType,
Source: 1,
SourceId: e.DocId || e.docID || e.docId || e.SourceId || e.Id,
SourceName: e.Assunto
})
})
}
else{
this.docs.push({
ApplicationId: this.document.ApplicationId || this.document.ApplicationType,
Source: 1,
SourceId: this.document.DocId || this.document.docID || this.document.docId || this.document.SourceId || this.document.Id,
SourceName: this.document.Assunto
})
}
let postEvent = {
EventId: '',
Subject: this.postData.Subject,
@@ -318,10 +330,11 @@ export class DocumentSetUpMeetingPage implements OnInit {
Type: this.EventRecurrenceType,
LastOccurrence: this.Occurrence,
},
// Attachments: this.docs,
Attachments: this.attachments,
}
const laoder = this.toastService.loading()
const laoder = this.toastService.loading();
this.eventService.create({ body: postEvent, calendar: this.postData.CalendarName }).subscribe(async (respose) => {
laoder.remove();