diff --git a/backend/src/services/questions.ts b/backend/src/services/questions.ts
index 09643cd2..24f753a3 100644
--- a/backend/src/services/questions.ts
+++ b/backend/src/services/questions.ts
@@ -90,7 +90,8 @@ export async function createQuestion(loId: LearningObjectIdentifier, questionDat
let assignment;
if (typeof questionData.inGroup.assignment === 'number' && typeof questionData.inGroup.class === 'string') {
- assignment = await fetchAssignment(questionData.inGroup.class, questionData.inGroup.assignment);
+ assignment = await fetchAssignment(questionData.inGroup.class,
+ questionData.inGroup.assignment);
} else {
// TODO check if necessary and no conflicts to delete this if
const clazz = await getClassRepository().findById((questionData.inGroup.assignment as AssignmentDTO).within);
diff --git a/backend/tests/test_assets/questions/answers.testdata.ts b/backend/tests/test_assets/questions/answers.testdata.ts
index 443f523d..5614cd6a 100644
--- a/backend/tests/test_assets/questions/answers.testdata.ts
+++ b/backend/tests/test_assets/questions/answers.testdata.ts
@@ -2,7 +2,6 @@ import { EntityManager } from '@mikro-orm/core';
import { Answer } from '../../../src/entities/questions/answer.entity';
import { Teacher } from '../../../src/entities/users/teacher.entity';
import { Question } from '../../../src/entities/questions/question.entity';
-import { getTestleerling1 } from '../users/students.testdata';
import { getTestleerkracht1 } from '../users/teachers.testdata';
import { getQuestion07 } from './questions.testdata';
diff --git a/frontend/src/components/QuestionNotification.vue b/frontend/src/components/QuestionNotification.vue
index 30d73e00..e9b6ed7e 100644
--- a/frontend/src/components/QuestionNotification.vue
+++ b/frontend/src/components/QuestionNotification.vue
@@ -1,24 +1,21 @@
{
+ function toggle (): void {
expanded.value = !expanded.value;
- };
+ }
- const formatDate = (timestamp: string | Date): string => {
+ function formatDate (timestamp: string | Date): string {
return new Date(timestamp).toLocaleString();
- };
+ }
const answersQuery = useAnswersQuery(
computed(
@@ -39,16 +39,16 @@
const answer = ref("");
- function submitAnswer() {
+ function submitAnswer(): void {
const answerData: AnswerData = {
author: authService.authState.user?.profile.preferred_username as string,
content: answer.value,
};
- if (answer.value != "") {
+ if (answer.value !== "") {
createAnswerMutation.mutate(answerData, {
- onSuccess: () => {
+ onSuccess: async () => {
answer.value = "";
- answersQuery.refetch();
+ await answersQuery.refetch();
},
});
} else {
diff --git a/frontend/src/views/learning-paths/LearningPathPage.vue b/frontend/src/views/learning-paths/LearningPathPage.vue
index e0199cfe..544bc117 100644
--- a/frontend/src/views/learning-paths/LearningPathPage.vue
+++ b/frontend/src/views/learning-paths/LearningPathPage.vue
@@ -165,7 +165,7 @@
const questionInput = ref("");
- function submitQuestion() {
+ function submitQuestion(): void {
const assignments = studentAssignmentsQueryResult.data.value?.assignments as AssignmentDTO[];
const assignment = assignments.find(
(assignment) => assignment.learningPath === props.hruid && assignment.language === props.language,
@@ -176,16 +176,16 @@
author: authService.authState.user?.profile.preferred_username,
content: questionInput.value,
inGroup: group, //TODO: POST response zegt dat dit null is???
- };
- console.log(questionData);
- if (questionInput.value != "") {
+ }
+ if (questionInput.value !== "") {
createQuestionMutation.mutate(questionData, {
- onSuccess: () => {
+ onSuccess: async () => {
questionInput.value = ""; // Clear the input field after submission
- getQuestionsQuery.refetch(); // Reload the questions
+ await getQuestionsQuery.refetch(); // Reload the questions
},
- onError: (e) => {
- console.error(e);
+ onError: (_) => {
+ // TODO Handle error
+ // - console.error(e);
},
});
} else {