fix: merge + types frontend controller
This commit is contained in:
parent
4ca568e738
commit
8ceed7f779
20 changed files with 129 additions and 92 deletions
|
|
@ -16,10 +16,10 @@ export function mapToAnswerDTO(answer: Answer): AnswerDTO {
|
|||
};
|
||||
}
|
||||
|
||||
export function mapToAnswerId(answer: AnswerDTO): AnswerId {
|
||||
export function mapToAnswerDTOId(answer: Answer): AnswerId {
|
||||
return {
|
||||
author: answer.author.username,
|
||||
toQuestion: mapToQuestionDTOId(answer.toQuestion),
|
||||
sequenceNumber: answer.sequenceNumber,
|
||||
sequenceNumber: answer.sequenceNumber!,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { Question } from '../entities/questions/question.entity.js';
|
||||
import { mapToStudentDTO } from './student.js';
|
||||
import { QuestionDTO, QuestionId } from 'dwengo-1-common/src/interfaces/question';
|
||||
import {LearningObjectIdentifier} from "../entities/content/learning-object-identifier";
|
||||
|
||||
function getLearningObjectIdentifier(question: Question): LearningObjectIdentifier {
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -1,16 +1,12 @@
|
|||
import { mapToStudentDTO, StudentDTO } from './student.js';
|
||||
import { mapToStudentDTO } from './student.js';
|
||||
import { ClassJoinRequest, ClassJoinRequestStatus } from '../entities/classes/class-join-request.entity.js';
|
||||
import { getClassJoinRequestRepository } from '../data/repositories.js';
|
||||
import { Student } from '../entities/users/student.entity.js';
|
||||
import { Class } from '../entities/classes/class.entity.js';
|
||||
import {ClassJoinRequestDTO} from "dwengo-1-common/src/interfaces/class-join-request";
|
||||
|
||||
export interface StudentRequestDTO {
|
||||
requester: StudentDTO;
|
||||
class: string;
|
||||
status: ClassJoinRequestStatus;
|
||||
}
|
||||
|
||||
export function mapToStudentRequestDTO(request: ClassJoinRequest): StudentRequestDTO {
|
||||
export function mapToStudentRequestDTO(request: ClassJoinRequest): ClassJoinRequestDTO {
|
||||
return {
|
||||
requester: mapToStudentDTO(request.requester),
|
||||
class: request.class.classId!,
|
||||
|
|
|
|||
Reference in a new issue