fix: merge + lint fixes
This commit is contained in:
parent
7f189188e8
commit
b556516359
12 changed files with 58 additions and 62 deletions
|
@ -1,8 +1,8 @@
|
|||
import { getAnswerRepository, getQuestionRepository } from '../data/repositories.js';
|
||||
import { mapToQuestionDTO, mapToQuestionId, QuestionDTO, QuestionId } from '../interfaces/question.js';
|
||||
import {mapToQuestionDTO, mapToQuestionDTOId, QuestionDTO, QuestionId} from '../interfaces/question.js';
|
||||
import { Question } from '../entities/questions/question.entity.js';
|
||||
import { Answer } from '../entities/questions/answer.entity.js';
|
||||
import { AnswerDTO, AnswerId, mapToAnswerDTO, mapToAnswerId } from '../interfaces/answer.js';
|
||||
import { AnswerDTO, AnswerId, mapToAnswerDTO, mapToAnswerDTOId } from '../interfaces/answer.js';
|
||||
import { QuestionRepository } from '../data/questions/question-repository.js';
|
||||
import { LearningObjectIdentifier } from '../entities/content/learning-object-identifier.js';
|
||||
import { mapToStudent } from '../interfaces/student.js';
|
||||
|
@ -15,13 +15,11 @@ export async function getAllQuestions(id: LearningObjectIdentifier, full: boolea
|
|||
return [];
|
||||
}
|
||||
|
||||
const questionsDTO: QuestionDTO[] = questions.map(mapToQuestionDTO);
|
||||
|
||||
if (full) {
|
||||
return questionsDTO;
|
||||
return questions.map(mapToQuestionDTO);
|
||||
}
|
||||
|
||||
return questionsDTO.map(mapToQuestionId);
|
||||
return questions.map(mapToQuestionDTOId);
|
||||
}
|
||||
|
||||
async function fetchQuestion(questionId: QuestionId): Promise<Question | null> {
|
||||
|
@ -59,13 +57,11 @@ export async function getAnswersByQuestion(questionId: QuestionId, full: boolean
|
|||
return [];
|
||||
}
|
||||
|
||||
const answersDTO = answers.map(mapToAnswerDTO);
|
||||
|
||||
if (full) {
|
||||
return answersDTO;
|
||||
return answers.map(mapToAnswerDTO);
|
||||
}
|
||||
|
||||
return answersDTO.map(mapToAnswerId);
|
||||
return answers.map(mapToAnswerDTOId);
|
||||
}
|
||||
|
||||
export async function createQuestion(questionDTO: QuestionDTO): Promise<QuestionDTO | null> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue