Skip to content

Commit ac89c1c

Browse files
committed
quickfix: findByName in integrations repository was not correctly scoped
1 parent 659b6d3 commit ac89c1c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/core/src/repositories/integrationsRepository.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { eq, getTableColumns } from 'drizzle-orm'
1+
import { and, eq, getTableColumns } from 'drizzle-orm'
22

33
import { IntegrationDto } from '../browser'
44
import { LatitudeError, NotFoundError, PromisedResult, Result } from '../lib'
@@ -23,7 +23,9 @@ export class IntegrationsRepository extends Repository<IntegrationDto> {
2323
async findByName(
2424
name: string,
2525
): PromisedResult<IntegrationDto, LatitudeError> {
26-
const result = await this.scope.where(eq(integrations.name, name))
26+
const result = await this.scope.where(
27+
and(eq(integrations.name, name), this.scopeFilter),
28+
)
2729

2830
if (!result.length) {
2931
return Result.error(new NotFoundError('Integration not found'))

0 commit comments

Comments
 (0)