fix: .js toevoegen aan imports

This commit is contained in:
Tibo De Peuter 2025-04-09 10:26:33 +02:00
parent c10fc8db17
commit 6297347206
Signed by: tdpeuter
GPG key ID: 38297DE43F75FFE2
6 changed files with 16 additions and 16 deletions

View file

@ -1,8 +1,8 @@
import { Request, Response } from 'express'; import { Request, Response } from 'express';
import { requireFields } from './error-helper'; import { requireFields } from './error-helper.js';
import { getLearningObjectId, getQuestionId } from './questions'; import { getLearningObjectId, getQuestionId } from './questions.js';
import { createAnswer, deleteAnswer, getAnswer, getAnswersByQuestion, updateAnswer } from '../services/answers'; import { createAnswer, deleteAnswer, getAnswer, getAnswersByQuestion, updateAnswer } from '../services/answers.js';
import { FALLBACK_SEQ_NUM } from '../config'; import { FALLBACK_SEQ_NUM } from '../config.js';
import { AnswerData } from '@dwengo-1/common/interfaces/answer'; import { AnswerData } from '@dwengo-1/common/interfaces/answer';
export async function getAllAnswersHandler(req: Request, res: Response): Promise<void> { export async function getAllAnswersHandler(req: Request, res: Response): Promise<void> {

View file

@ -4,7 +4,7 @@ import { FALLBACK_LANG, FALLBACK_SEQ_NUM, FALLBACK_VERSION_NUM } from '../config
import { LearningObjectIdentifier } from '../entities/content/learning-object-identifier.js'; import { LearningObjectIdentifier } from '../entities/content/learning-object-identifier.js';
import { QuestionData, QuestionId } from '@dwengo-1/common/interfaces/question'; import { QuestionData, QuestionId } from '@dwengo-1/common/interfaces/question';
import { Language } from '@dwengo-1/common/util/language'; import { Language } from '@dwengo-1/common/util/language';
import { requireFields } from './error-helper'; import { requireFields } from './error-helper.js';
export function getLearningObjectId(hruid: string, version: string, lang: string): LearningObjectIdentifier { export function getLearningObjectId(hruid: string, version: string, lang: string): LearningObjectIdentifier {
return { return {

View file

@ -1,7 +1,7 @@
import { mapToQuestionDTO, mapToQuestionDTOId } from './question.js'; import { mapToQuestionDTO, mapToQuestionDTOId } from './question.js';
import { Answer } from '../entities/questions/answer.entity.js'; import { Answer } from '../entities/questions/answer.entity.js';
import { AnswerDTO, AnswerId } from '@dwengo-1/common/interfaces/answer'; import { AnswerDTO, AnswerId } from '@dwengo-1/common/interfaces/answer';
import { mapToTeacherDTO } from './teacher'; import { mapToTeacherDTO } from './teacher.js';
/** /**
* Convert a Question entity to a DTO format. * Convert a Question entity to a DTO format.

View file

@ -1,5 +1,5 @@
import express from 'express'; import express from 'express';
import { createAnswerHandler, deleteAnswerHandler, getAnswerHandler, getAllAnswersHandler, updateAnswerHandler } from '../controllers/answers'; import { createAnswerHandler, deleteAnswerHandler, getAnswerHandler, getAllAnswersHandler, updateAnswerHandler } from '../controllers/answers.js';
const router = express.Router({ mergeParams: true }); const router = express.Router({ mergeParams: true });

View file

@ -1,11 +1,11 @@
import { getAnswerRepository } from '../data/repositories'; import { getAnswerRepository } from '../data/repositories.js';
import { Answer } from '../entities/questions/answer.entity'; import { Answer } from '../entities/questions/answer.entity.js';
import { mapToAnswerDTO, mapToAnswerDTOId } from '../interfaces/answer'; import { mapToAnswerDTO, mapToAnswerDTOId } from '../interfaces/answer.js';
import { fetchTeacher } from './teachers'; import { fetchTeacher } from './teachers.js';
import { fetchQuestion } from './questions'; import { fetchQuestion } from './questions.js';
import { QuestionId } from '@dwengo-1/common/interfaces/question'; import { QuestionId } from '@dwengo-1/common/interfaces/question';
import { AnswerData, AnswerDTO, AnswerId } from '@dwengo-1/common/interfaces/answer'; import { AnswerData, AnswerDTO, AnswerId } from '@dwengo-1/common/interfaces/answer';
import { NotFoundException } from '../exceptions/not-found-exception'; import { NotFoundException } from '../exceptions/not-found-exception.js';
export async function getAnswersByQuestion(questionId: QuestionId, full: boolean): Promise<AnswerDTO[] | AnswerId[]> { export async function getAnswersByQuestion(questionId: QuestionId, full: boolean): Promise<AnswerDTO[] | AnswerId[]> {
const answerRepository = getAnswerRepository(); const answerRepository = getAnswerRepository();

View file

@ -4,9 +4,9 @@ import { Question } from '../entities/questions/question.entity.js';
import { QuestionRepository } from '../data/questions/question-repository.js'; import { QuestionRepository } from '../data/questions/question-repository.js';
import { LearningObjectIdentifier } from '../entities/content/learning-object-identifier.js'; import { LearningObjectIdentifier } from '../entities/content/learning-object-identifier.js';
import { QuestionData, QuestionDTO, QuestionId } from '@dwengo-1/common/interfaces/question'; import { QuestionData, QuestionDTO, QuestionId } from '@dwengo-1/common/interfaces/question';
import { NotFoundException } from '../exceptions/not-found-exception'; import { NotFoundException } from '../exceptions/not-found-exception.js';
import { FALLBACK_VERSION_NUM } from '../config'; import { FALLBACK_VERSION_NUM } from '../config.js';
import { fetchStudent } from './students'; import { fetchStudent } from './students.js';
export async function getAllQuestions(id: LearningObjectIdentifier, full: boolean): Promise<QuestionDTO[] | QuestionId[]> { export async function getAllQuestions(id: LearningObjectIdentifier, full: boolean): Promise<QuestionDTO[] | QuestionId[]> {
const questionRepository: QuestionRepository = getQuestionRepository(); const questionRepository: QuestionRepository = getQuestionRepository();