Apply suggestions from code review

Co-authored-by: Tomi Turtiainen <10324676+tomi@users.noreply.github.com>
This commit is contained in:
Eugene 2024-11-11 11:51:42 +01:00 committed by GitHub
parent eee51ebe92
commit 66c189ea00
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -10,7 +10,7 @@ import { TestDefinitionsRequest } from './test-definitions.types.ee';
@RestController('/evaluation/test-definitions')
export class TestDefinitionsController {
constructor(private readonly testsService: TestDefinitionsService) {}
constructor(private readonly testDefinitionsService: TestDefinitionsService) {}
@Get('/', { middlewares: listQueryMiddleware })
async getMany(req: TestDefinitionsRequest.GetMany) {
@ -29,7 +29,7 @@ export class TestDefinitionsController {
const testDefinition = await this.testsService.findOne(Number(req.params.id), workflowIds);
if (!testDefinition) throw new NotFoundError('Test not found');
if (!testDefinition) throw new NotFoundError('Test definition not found');
return testDefinition;
}
@ -57,7 +57,7 @@ export class TestDefinitionsController {
const workflowIds = await getSharedWorkflowIds(req.user, ['workflow:read']);
if (workflowIds.length === 0) throw new NotFoundError('Test not found');
if (workflowIds.length === 0) throw new NotFoundError('Test definition not found');
await this.testsService.delete(Number(req.params.id), workflowIds);

View file

@ -20,7 +20,7 @@ type TestDefinitionLike = Omit<
@Service()
export class TestDefinitionsService {
constructor(
private testRepository: TestDefinitionRepository,
private testDefinitionRepository: TestDefinitionRepository,
private annotationTagRepository: AnnotationTagRepository,
) {}