feat: add user submission functionality

This commit is contained in:
2026-07-05 21:45:45 +03:30
parent afb5045cf0
commit 7b44542ce7
48 changed files with 1459 additions and 55 deletions
@@ -35,14 +35,6 @@ export class QuestionsCommandProvider {
public async createOne(createQuestionDto: CreateQuestionDTO) {
const test = await this.testsService.adminGetOne(createQuestionDto.test);
if (!test) {
throw new AppException(
'common.errors.entityNotFound',
HttpStatus.NOT_FOUND,
{ entity: '$t(tests.fields.test)' },
);
}
const newQuestion = this.questionsRepository.create({
...createQuestionDto,
test,
@@ -81,15 +73,7 @@ export class QuestionsCommandProvider {
}
if (updateQuestionDto.test) {
const test = await this.testsService.adminGetOne(updateQuestionDto.test);
if (!test) {
throw new AppException(
'common.errors.entityNotFound',
HttpStatus.NOT_FOUND,
{ entity: '$t(tests.fields.test)' },
);
}
await this.testsService.adminGetOne(updateQuestionDto.test);
}
const type =