Skip to content

Commit

Permalink
fix custom project ownership check query
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeh committed Jan 31, 2025
1 parent cb922b4 commit cc71c1a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion api/src/modules/custom-projects/custom-projects.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,12 @@ export class CustomProjectsService extends AppBaseService<
userId: string,
projectIds: string[],
): Promise<boolean> {
const customProjects = await this.repo.findBy({ id: In(projectIds) });
const customProjects = await this.repo.find({
where: {
id: In(projectIds),
},
relations: ['user'],
});

return customProjects.every(
(customProject) => customProject.user?.id === userId,
Expand Down
2 changes: 1 addition & 1 deletion api/test/integration/import/import.repository.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ProjectScorecard } from '@shared/entities/project-scorecard.entity';
import { TestManager } from 'api/test/utils/test-manager';
import { TestManager } from '../../utils/test-manager';

describe('Import Repository', () => {
let testManager: TestManager;
Expand Down

0 comments on commit cc71c1a

Please sign in to comment.