Skip to content

Commit

Permalink
fix(api): add organization collection context (#4629)
Browse files Browse the repository at this point in the history
  • Loading branch information
scopsy authored Oct 23, 2023
1 parent afc3c46 commit cc476dd
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ export class RemoveIntegration {

async execute(command: RemoveIntegrationCommand) {
try {
const existingIntegration = await this.integrationRepository.findById(command.integrationId);
const existingIntegration = await this.integrationRepository.findOne({
_id: command.integrationId,
_organizationId: command.organizationId,
});
if (!existingIntegration) {
throw new NotFoundException(`Entity with id ${command.integrationId} not found`);
}
Expand Down

0 comments on commit cc476dd

Please sign in to comment.