feat: add choices entity admin crud

This commit is contained in:
2026-06-17 11:11:26 +03:30
parent 0eea63fec1
commit 1e8036abca
31 changed files with 805 additions and 201 deletions
@@ -1,4 +1,4 @@
import { Injectable, NotFoundException } from '@nestjs/common';
import { HttpStatus, Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { PaginatedResponse } from '@/common/responses';
@@ -7,6 +7,7 @@ import { FindTestsDTO } from '../dtos/find-tests.dto';
import { filterTests } from '../helpers/filter-tests.helper';
import Utils from '@/common/utils';
import { Test } from '../entities/test.entity';
import { AppException } from '@/common/exceptions/app.exception';
@Injectable()
export class TestsQueryProvider {
@@ -90,7 +91,11 @@ export class TestsQueryProvider {
}
if (!test) {
throw new NotFoundException('tests.errors.testNotFound');
throw new AppException(
'common.errors.entityNotFound',
HttpStatus.NOT_FOUND,
{ entity: '$t(tests.fields.test)' },
);
}
return test;