feat: add user submission functionality
This commit is contained in:
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user