@ -160,14 +160,14 @@ export class CalendarEventParticipantRepository {
|
||||
);
|
||||
}
|
||||
|
||||
public async updateCalendarEventParticipants(
|
||||
public async updateCalendarEventParticipantsAndReturnNewOnes(
|
||||
calendarEventParticipants: CalendarEventParticipant[],
|
||||
iCalUIDCalendarEventIdMap: Map<string, string>,
|
||||
workspaceId: string,
|
||||
transactionManager?: EntityManager,
|
||||
): Promise<void> {
|
||||
): Promise<CalendarEventParticipant[]> {
|
||||
if (calendarEventParticipants.length === 0) {
|
||||
return;
|
||||
return [];
|
||||
}
|
||||
|
||||
const dataSourceSchema =
|
||||
@ -189,6 +189,14 @@ export class CalendarEventParticipantRepository {
|
||||
calendarEventParticipant.handle,
|
||||
);
|
||||
|
||||
const newCalendarEventParticipants = differenceWith(
|
||||
calendarEventParticipants,
|
||||
existingCalendarEventParticipants,
|
||||
(calendarEventParticipant, existingCalendarEventParticipant) =>
|
||||
calendarEventParticipant.handle ===
|
||||
existingCalendarEventParticipant.handle,
|
||||
);
|
||||
|
||||
await this.deleteByIds(
|
||||
calendarEventParticipantsToDelete.map(
|
||||
(calendarEventParticipant) => calendarEventParticipant.id,
|
||||
@ -227,6 +235,8 @@ export class CalendarEventParticipantRepository {
|
||||
workspaceId,
|
||||
transactionManager,
|
||||
);
|
||||
|
||||
return newCalendarEventParticipants;
|
||||
}
|
||||
|
||||
public async getWithoutPersonIdAndWorkspaceMemberId(
|
||||
|
||||
Reference in New Issue
Block a user