Calendar event fixes and improvements (#4690)
* fixes * saving workspaceMemberId and personId when saving attendees * add typing * use Map * improve saveMessageParticipants * fix role type * move logic in a service * create new service * use new service in calendar-event-attendee.service * modify service to include more common logic * add defaumt value to isOrganizer in calendar-event-attendee.object-metadata * rename folder * renaming
This commit is contained in:
@ -78,38 +78,6 @@ export class CalendarEventAttendeeRepository {
|
||||
);
|
||||
}
|
||||
|
||||
public async saveCalendarEventAttendees(
|
||||
calendarEventAttendees: CalendarEventAttendee[],
|
||||
workspaceId: string,
|
||||
transactionManager?: EntityManager,
|
||||
): Promise<void> {
|
||||
if (calendarEventAttendees.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const dataSourceSchema =
|
||||
this.workspaceDataSourceService.getSchemaName(workspaceId);
|
||||
|
||||
const { flattenedValues, valuesString } =
|
||||
getFlattenedValuesAndValuesStringForBatchRawQuery(
|
||||
calendarEventAttendees,
|
||||
{
|
||||
calendarEventId: 'uuid',
|
||||
handle: 'text',
|
||||
displayName: 'text',
|
||||
isOrganizer: 'boolean',
|
||||
responseStatus: `${dataSourceSchema}."calendarEventAttendee_responsestatus_enum"`,
|
||||
},
|
||||
);
|
||||
|
||||
await this.workspaceDataSourceService.executeRawQuery(
|
||||
`INSERT INTO ${dataSourceSchema}."calendarEventAttendee" ("calendarEventId", "handle", "displayName", "isOrganizer", "responseStatus") VALUES ${valuesString}`,
|
||||
flattenedValues,
|
||||
workspaceId,
|
||||
transactionManager,
|
||||
);
|
||||
}
|
||||
|
||||
public async updateCalendarEventAttendees(
|
||||
calendarEventAttendees: CalendarEventAttendee[],
|
||||
iCalUIDCalendarEventIdMap: Map<string, string>,
|
||||
|
||||
Reference in New Issue
Block a user