mirror of
https://github.com/docmost/docmost.git
synced 2026-08-24 09:02:17 +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();
|
.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(
|
async deleteUserLink(
|
||||||
integrationId: string,
|
integrationId: string,
|
||||||
userId: string,
|
userId: string,
|
||||||
|
|||||||
Reference in New Issue
Block a user