feat add questions module and admin routes
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import { FindOptionsWhere, ILike } from 'typeorm';
|
||||
import { FindTestsDTO } from '../dtos/find-tests.dto';
|
||||
import { Test } from '../entities/test.entity';
|
||||
|
||||
export const filterTests = (query: FindTestsDTO) => {
|
||||
const where: FindOptionsWhere<any> = {};
|
||||
const where: FindOptionsWhere<Test> = {};
|
||||
|
||||
if (query.id) {
|
||||
where.id = query.id;
|
||||
|
||||
@@ -70,9 +70,7 @@ export class TestsCommandProvider {
|
||||
(accessType === AccessType.PAID && !price) ||
|
||||
(accessType !== AccessType.PAID && price)
|
||||
) {
|
||||
throw new BadRequestException(
|
||||
this.i18nService.translate('tests.errors.priceAccessConstraint'),
|
||||
);
|
||||
throw new BadRequestException('tests.errors.priceAccessConstraint');
|
||||
}
|
||||
|
||||
Object.assign(test, updateTestDto);
|
||||
|
||||
@@ -12,8 +12,6 @@ export class PriceAccessTypeConstraint implements ValidatorConstraintInterface {
|
||||
_: any,
|
||||
validationArguments?: ValidationArguments,
|
||||
): Promise<boolean> | boolean {
|
||||
console.log('This is happening');
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const obj = validationArguments?.object as any;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
|
||||
Reference in New Issue
Block a user