diff --git a/apps/server/src/core/integration/repos/integration-connection.repo.ts b/apps/server/src/core/integration/repos/integration-connection.repo.ts index a1c85dda2..838b11f22 100644 --- a/apps/server/src/core/integration/repos/integration-connection.repo.ts +++ b/apps/server/src/core/integration/repos/integration-connection.repo.ts @@ -257,6 +257,21 @@ export class IntegrationConnectionRepo { .executeTakeFirst(); } + async findUserLinkByUserId( + integrationId: string, + userId: string, + trx?: KyselyTransaction, + ): Promise { + const db = dbOrTx(this.db, trx); + return db + .selectFrom('integrationConnections') + .selectAll() + .where('integrationId', '=', integrationId) + .where('userId', '=', userId) + .where('kind', '=', 'user') + .executeTakeFirst(); + } + async deleteUserLink( integrationId: string, userId: string,