4746 create created listener on blocklist for calendar (#5046)

Follows #5031.
Closes #4746
This commit is contained in:
bosiraphael
2024-04-23 11:46:27 +02:00
committed by GitHub
parent 8f6460bec5
commit 824786ff04
20 changed files with 278 additions and 31 deletions

View File

@ -95,6 +95,27 @@ export class CalendarChannelRepository {
);
}
public async getIdsByWorkspaceMemberId(
workspaceMemberId: string,
workspaceId: string,
transactionManager?: EntityManager,
): Promise<ObjectRecord<CalendarChannelObjectMetadata>[]> {
const dataSourceSchema =
this.workspaceDataSourceService.getSchemaName(workspaceId);
const calendarChannelIds =
await this.workspaceDataSourceService.executeRawQuery(
`SELECT "calendarChannel".id FROM ${dataSourceSchema}."calendarChannel" "calendarChannel"
JOIN ${dataSourceSchema}."connectedAccount" ON "calendarChannel"."connectedAccountId" = ${dataSourceSchema}."connectedAccount"."id"
WHERE ${dataSourceSchema}."connectedAccount"."accountOwnerId" = $1`,
[workspaceMemberId],
workspaceId,
transactionManager,
);
return calendarChannelIds;
}
public async updateSyncCursor(
syncCursor: string,
calendarChannelId: string,