From 84b2cb17497e3fa7600d36e97cc27da2768c3e99 Mon Sep 17 00:00:00 2001 From: Lint Action Date: Mon, 19 May 2025 21:44:54 +0000 Subject: [PATCH] style: fix linting issues met Prettier --- frontend/src/controllers/questions.ts | 7 +++- frontend/src/queries/questions.ts | 18 ++++++++-- .../views/learning-paths/LearningPathPage.vue | 34 ++++++++++--------- 3 files changed, 40 insertions(+), 19 deletions(-) diff --git a/frontend/src/controllers/questions.ts b/frontend/src/controllers/questions.ts index bca464ae..fb4149f4 100644 --- a/frontend/src/controllers/questions.ts +++ b/frontend/src/controllers/questions.ts @@ -18,7 +18,12 @@ export class QuestionController extends BaseController { this.loId = loId; } - async getAllGroup(classId: string, assignmentId: string, forStudent: string, full = true): Promise { + async getAllGroup( + classId: string, + assignmentId: string, + forStudent: string, + full = true, + ): Promise { return this.get("/", { lang: this.loId.language, full, classId, assignmentId, forStudent }); } diff --git a/frontend/src/queries/questions.ts b/frontend/src/queries/questions.ts index a8fc485e..920f41da 100644 --- a/frontend/src/queries/questions.ts +++ b/frontend/src/queries/questions.ts @@ -51,8 +51,22 @@ export function useQuestionsGroupQuery( full: MaybeRefOrGetter = true, ): UseQueryReturnType { return useQuery({ - queryKey: computed(() => questionsGroupQueryKey(toValue(loId), toValue(full), toValue(classId), toValue(assignmentId), toValue(student))), - queryFn: async () => new QuestionController(toValue(loId)).getAllGroup( toValue(classId), toValue(assignmentId), toValue(student),toValue(full)), + queryKey: computed(() => + questionsGroupQueryKey( + toValue(loId), + toValue(full), + toValue(classId), + toValue(assignmentId), + toValue(student), + ), + ), + queryFn: async () => + new QuestionController(toValue(loId)).getAllGroup( + toValue(classId), + toValue(assignmentId), + toValue(student), + toValue(full), + ), enabled: () => Boolean(toValue(loId)), }); } diff --git a/frontend/src/views/learning-paths/LearningPathPage.vue b/frontend/src/views/learning-paths/LearningPathPage.vue index 1618e6ac..cdf51703 100644 --- a/frontend/src/views/learning-paths/LearningPathPage.vue +++ b/frontend/src/views/learning-paths/LearningPathPage.vue @@ -13,7 +13,7 @@ import authService from "@/services/auth/auth-service.ts"; import { LearningPathNode } from "@/data-objects/learning-paths/learning-path-node.ts"; import LearningPathGroupSelector from "@/views/learning-paths/LearningPathGroupSelector.vue"; - import {useQuestionsGroupQuery, useQuestionsQuery} from "@/queries/questions"; + import { useQuestionsGroupQuery, useQuestionsQuery } from "@/queries/questions"; import type { QuestionsResponse } from "@/controllers/questions"; import type { LearningObjectIdentifierDTO } from "@dwengo-1/common/interfaces/learning-content"; import QandA from "@/components/QandA.vue"; @@ -76,30 +76,32 @@ return currentIndex < nodesList.value?.length ? nodesList.value?.[currentIndex - 1] : undefined; }); - - let getQuestionsQuery; - - if (authService.authState.activeRole === AccountType.Student) { getQuestionsQuery = useQuestionsGroupQuery( - computed(() => ({ - language: currentNode.value?.language, - hruid: currentNode.value?.learningobjectHruid, - version: currentNode.value?.version, - }) as LearningObjectIdentifierDTO), + computed( + () => + ({ + language: currentNode.value?.language, + hruid: currentNode.value?.learningobjectHruid, + version: currentNode.value?.version, + }) as LearningObjectIdentifierDTO, + ), computed(() => query.value.classId ?? ""), computed(() => query.value.assignmentNo ?? ""), - computed(() => authService.authState.user?.profile.preferred_username ?? "") + computed(() => authService.authState.user?.profile.preferred_username ?? ""), ); } else { getQuestionsQuery = useQuestionsQuery( - computed(() => ({ - language: currentNode.value?.language, - hruid: currentNode.value?.learningobjectHruid, - version: currentNode.value?.version, - }) as LearningObjectIdentifierDTO) + computed( + () => + ({ + language: currentNode.value?.language, + hruid: currentNode.value?.learningobjectHruid, + version: currentNode.value?.version, + }) as LearningObjectIdentifierDTO, + ), ); }