fix: merge + lint fixes

This commit is contained in:
Gabriellvl 2025-04-01 18:38:36 +02:00
parent 7f189188e8
commit b556516359
12 changed files with 58 additions and 62 deletions

View file

@ -1,5 +1,5 @@
import { mapToUserDTO, UserDTO } from './user.js';
import { mapToQuestionDTO, mapToQuestionId, QuestionDTO, QuestionId } from './question.js';
import {mapToQuestionDTO, mapToQuestionDTOId, QuestionDTO, QuestionId} from './question.js';
import { Answer } from '../entities/questions/answer.entity.js';
export interface AnswerDTO {
@ -29,10 +29,10 @@ export interface AnswerId {
sequenceNumber: number;
}
export function mapToAnswerId(answer: AnswerDTO): AnswerId {
export function mapToAnswerDTOId(answer: Answer): AnswerId {
return {
author: answer.author.username,
toQuestion: mapToQuestionId(answer.toQuestion),
sequenceNumber: answer.sequenceNumber,
toQuestion: mapToQuestionDTOId(answer.toQuestion),
sequenceNumber: answer.sequenceNumber!,
};
}

View file

@ -18,7 +18,7 @@ export function mapToStudentRequestDTO(request: ClassJoinRequest): StudentReques
};
}
export function mapToStudentRequest(student: Student, cls: Class) {
export function mapToStudentRequest(student: Student, cls: Class): ClassJoinRequest {
return getClassJoinRequestRepository().create({
requester: student,
class: cls,