mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
create event from attachment
This commit is contained in:
@@ -162,7 +162,7 @@ export class AgendaDataRepositoryService {
|
||||
|
||||
}
|
||||
|
||||
createEvent(eventData: Event, documents, calendar: TableSharedCalendar, tracing: TracingType) {
|
||||
createEvent(eventData: Event, documents, calendar: TableSharedCalendar, tracing: TracingType, addAll =false) {
|
||||
|
||||
console.log('eventData', eventData);
|
||||
|
||||
@@ -177,7 +177,7 @@ export class AgendaDataRepositoryService {
|
||||
type: this.utils.calendarTypeSeleted(eventData.Category),
|
||||
category: this.utils.calendarCategorySeleted(eventData.CalendarName),
|
||||
attendees: this.utils.attendeesAdded(eventData.Attendees),
|
||||
attachments: this.utils.documentAdded(documents),
|
||||
attachments: this.utils.documentAdded(documents, addAll),
|
||||
recurrence: {
|
||||
frequency: this.utils.eventRecurence(eventData.EventRecurrence.frequency),
|
||||
until:((eventData.EventRecurrence.until === "") ? this.utils.addOneHourToIsoString(eventData.EndDate.toISOString()) : eventData.EventRecurrence.until),
|
||||
@@ -243,7 +243,7 @@ export class AgendaDataRepositoryService {
|
||||
addEventAttachment(id, attachmentData, tracing: TracingType) {
|
||||
console.log(attachmentData)
|
||||
|
||||
const attachments = { attachments: this.utils.documentAdded(attachmentData) }
|
||||
const attachments = { attachments: this.utils.documentAdded(attachmentData, false) }
|
||||
APINODReturn(AttachInputDTOSchema, attachments, `POST/${id}/Attendee`, tracing)
|
||||
return this.agendaDataService.addEventAttachment(id, attachments);
|
||||
}
|
||||
|
||||
@@ -73,17 +73,19 @@ export class Utils {
|
||||
'Meeting': 1,
|
||||
'Travel': 2,
|
||||
'Conference': 3,
|
||||
'Encontro': 1
|
||||
'Encontro': 1,
|
||||
'Reunião': 1,
|
||||
'Conferência': 3
|
||||
}
|
||||
return selectedType[calendarName];
|
||||
}
|
||||
|
||||
documentAdded(documents: any[]) {
|
||||
documentAdded(documents: any[], addAll: Boolean) {
|
||||
console.log('added doc create event', documents)
|
||||
let listupdate = []
|
||||
documents.forEach(element => {
|
||||
let object = {
|
||||
docId: element.docId || element.DocId || element.Id,
|
||||
docId: element.SourceId || element.docId || element.DocId || element.Id,
|
||||
sourceName: element.subject || element.sourceNames || element.Description || element.SourceName || element.Assunto,
|
||||
description: "",
|
||||
applicationId: element.applicationId || element.ApplicationId
|
||||
@@ -92,7 +94,10 @@ export class Utils {
|
||||
listupdate.push(object)
|
||||
});
|
||||
|
||||
return listupdate.filter( e=> typeof e.docId == 'number')
|
||||
|
||||
console.log({listupdate})
|
||||
|
||||
return listupdate.filter( e=> typeof e.docId == 'number' || addAll)
|
||||
|
||||
/* return documents.map((e) => {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user