mirror of
https://github.com/docmost/docmost.git
synced 2026-08-19 12:41:37 +10:00
feat(integration): add kind-filtered user link lookup by user id
This commit is contained in:
@@ -257,6 +257,21 @@ export class IntegrationConnectionRepo {
|
||||
.executeTakeFirst();
|
||||
}
|
||||
|
||||
async findUserLinkByUserId(
|
||||
integrationId: string,
|
||||
userId: string,
|
||||
trx?: KyselyTransaction,
|
||||
): Promise<IntegrationConnection | undefined> {
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user