feat: add choices entity admin crud
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user