diff --git a/backend/src/controllers/answers.ts b/backend/src/controllers/answers.ts index eaf51749..38cebe84 100644 --- a/backend/src/controllers/answers.ts +++ b/backend/src/controllers/answers.ts @@ -1,8 +1,8 @@ import { Request, Response } from 'express'; -import { requireFields } from './error-helper'; -import { getLearningObjectId, getQuestionId } from './questions'; -import { createAnswer, deleteAnswer, getAnswer, getAnswersByQuestion, updateAnswer } from '../services/answers'; -import { FALLBACK_SEQ_NUM } from '../config'; +import { requireFields } from './error-helper.js'; +import { getLearningObjectId, getQuestionId } from './questions.js'; +import { createAnswer, deleteAnswer, getAnswer, getAnswersByQuestion, updateAnswer } from '../services/answers.js'; +import { FALLBACK_SEQ_NUM } from '../config.js'; import { AnswerData } from '@dwengo-1/common/interfaces/answer'; export async function getAllAnswersHandler(req: Request, res: Response): Promise { diff --git a/backend/src/controllers/questions.ts b/backend/src/controllers/questions.ts index 1158e041..dfb3ef6c 100644 --- a/backend/src/controllers/questions.ts +++ b/backend/src/controllers/questions.ts @@ -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 { QuestionData, QuestionId } from '@dwengo-1/common/interfaces/question'; 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 { return { diff --git a/backend/src/interfaces/answer.ts b/backend/src/interfaces/answer.ts index b78c579f..513fc63e 100644 --- a/backend/src/interfaces/answer.ts +++ b/backend/src/interfaces/answer.ts @@ -1,7 +1,7 @@ import { mapToQuestionDTO, mapToQuestionDTOId } from './question.js'; import { Answer } from '../entities/questions/answer.entity.js'; 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. diff --git a/backend/src/routes/answers.ts b/backend/src/routes/answers.ts index 5800733a..b74f76a0 100644 --- a/backend/src/routes/answers.ts +++ b/backend/src/routes/answers.ts @@ -1,5 +1,5 @@ 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 }); diff --git a/backend/src/services/answers.ts b/backend/src/services/answers.ts index f2abad51..ab603883 100644 --- a/backend/src/services/answers.ts +++ b/backend/src/services/answers.ts @@ -1,11 +1,11 @@ -import { getAnswerRepository } from '../data/repositories'; -import { Answer } from '../entities/questions/answer.entity'; -import { mapToAnswerDTO, mapToAnswerDTOId } from '../interfaces/answer'; -import { fetchTeacher } from './teachers'; -import { fetchQuestion } from './questions'; +import { getAnswerRepository } from '../data/repositories.js'; +import { Answer } from '../entities/questions/answer.entity.js'; +import { mapToAnswerDTO, mapToAnswerDTOId } from '../interfaces/answer.js'; +import { fetchTeacher } from './teachers.js'; +import { fetchQuestion } from './questions.js'; import { QuestionId } from '@dwengo-1/common/interfaces/question'; 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 { const answerRepository = getAnswerRepository(); diff --git a/backend/src/services/questions.ts b/backend/src/services/questions.ts index d2e6440e..2dd7da1c 100644 --- a/backend/src/services/questions.ts +++ b/backend/src/services/questions.ts @@ -4,9 +4,9 @@ import { Question } from '../entities/questions/question.entity.js'; import { QuestionRepository } from '../data/questions/question-repository.js'; import { LearningObjectIdentifier } from '../entities/content/learning-object-identifier.js'; import { QuestionData, QuestionDTO, QuestionId } from '@dwengo-1/common/interfaces/question'; -import { NotFoundException } from '../exceptions/not-found-exception'; -import { FALLBACK_VERSION_NUM } from '../config'; -import { fetchStudent } from './students'; +import { NotFoundException } from '../exceptions/not-found-exception.js'; +import { FALLBACK_VERSION_NUM } from '../config.js'; +import { fetchStudent } from './students.js'; export async function getAllQuestions(id: LearningObjectIdentifier, full: boolean): Promise { const questionRepository: QuestionRepository = getQuestionRepository();