style: fix linting issues met Prettier
This commit is contained in:
		
							parent
							
								
									f85abea6f3
								
							
						
					
					
						commit
						84b2cb1749
					
				
					 3 changed files with 40 additions and 19 deletions
				
			
		|  | @ -18,7 +18,12 @@ export class QuestionController extends BaseController { | ||||||
|         this.loId = loId; |         this.loId = loId; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     async getAllGroup(classId: string, assignmentId: string, forStudent: string, full = true): Promise<QuestionsResponse> { |     async getAllGroup( | ||||||
|  |         classId: string, | ||||||
|  |         assignmentId: string, | ||||||
|  |         forStudent: string, | ||||||
|  |         full = true, | ||||||
|  |     ): Promise<QuestionsResponse> { | ||||||
|         return this.get<QuestionsResponse>("/", { lang: this.loId.language, full, classId, assignmentId, forStudent }); |         return this.get<QuestionsResponse>("/", { lang: this.loId.language, full, classId, assignmentId, forStudent }); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -51,8 +51,22 @@ export function useQuestionsGroupQuery( | ||||||
|     full: MaybeRefOrGetter<boolean> = true, |     full: MaybeRefOrGetter<boolean> = true, | ||||||
| ): UseQueryReturnType<QuestionsResponse, Error> { | ): UseQueryReturnType<QuestionsResponse, Error> { | ||||||
|     return useQuery({ |     return useQuery({ | ||||||
|         queryKey: computed(() => questionsGroupQueryKey(toValue(loId), toValue(full), toValue(classId), toValue(assignmentId), toValue(student))), |         queryKey: computed(() => | ||||||
|         queryFn: async () => new QuestionController(toValue(loId)).getAllGroup( toValue(classId), toValue(assignmentId), toValue(student),toValue(full)), |             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)), |         enabled: () => Boolean(toValue(loId)), | ||||||
|     }); |     }); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -13,7 +13,7 @@ | ||||||
|     import authService from "@/services/auth/auth-service.ts"; |     import authService from "@/services/auth/auth-service.ts"; | ||||||
|     import { LearningPathNode } from "@/data-objects/learning-paths/learning-path-node.ts"; |     import { LearningPathNode } from "@/data-objects/learning-paths/learning-path-node.ts"; | ||||||
|     import LearningPathGroupSelector from "@/views/learning-paths/LearningPathGroupSelector.vue"; |     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 { QuestionsResponse } from "@/controllers/questions"; | ||||||
|     import type { LearningObjectIdentifierDTO } from "@dwengo-1/common/interfaces/learning-content"; |     import type { LearningObjectIdentifierDTO } from "@dwengo-1/common/interfaces/learning-content"; | ||||||
|     import QandA from "@/components/QandA.vue"; |     import QandA from "@/components/QandA.vue"; | ||||||
|  | @ -76,30 +76,32 @@ | ||||||
|         return currentIndex < nodesList.value?.length ? nodesList.value?.[currentIndex - 1] : undefined; |         return currentIndex < nodesList.value?.length ? nodesList.value?.[currentIndex - 1] : undefined; | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
|     let getQuestionsQuery; |     let getQuestionsQuery; | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
|     if (authService.authState.activeRole === AccountType.Student) { |     if (authService.authState.activeRole === AccountType.Student) { | ||||||
|         getQuestionsQuery = useQuestionsGroupQuery( |         getQuestionsQuery = useQuestionsGroupQuery( | ||||||
|             computed(() => ({ |             computed( | ||||||
|                 language: currentNode.value?.language, |                 () => | ||||||
|                 hruid: currentNode.value?.learningobjectHruid, |                     ({ | ||||||
|                 version: currentNode.value?.version, |                         language: currentNode.value?.language, | ||||||
|             }) as LearningObjectIdentifierDTO), |                         hruid: currentNode.value?.learningobjectHruid, | ||||||
|  |                         version: currentNode.value?.version, | ||||||
|  |                     }) as LearningObjectIdentifierDTO, | ||||||
|  |             ), | ||||||
|             computed(() => query.value.classId ?? ""), |             computed(() => query.value.classId ?? ""), | ||||||
|             computed(() => query.value.assignmentNo ?? ""), |             computed(() => query.value.assignmentNo ?? ""), | ||||||
|             computed(() => authService.authState.user?.profile.preferred_username ?? "") |             computed(() => authService.authState.user?.profile.preferred_username ?? ""), | ||||||
|         ); |         ); | ||||||
|     } else { |     } else { | ||||||
|         getQuestionsQuery = useQuestionsQuery( |         getQuestionsQuery = useQuestionsQuery( | ||||||
|             computed(() => ({ |             computed( | ||||||
|                 language: currentNode.value?.language, |                 () => | ||||||
|                 hruid: currentNode.value?.learningobjectHruid, |                     ({ | ||||||
|                 version: currentNode.value?.version, |                         language: currentNode.value?.language, | ||||||
|             }) as LearningObjectIdentifierDTO) |                         hruid: currentNode.value?.learningobjectHruid, | ||||||
|  |                         version: currentNode.value?.version, | ||||||
|  |                     }) as LearningObjectIdentifierDTO, | ||||||
|  |             ), | ||||||
|         ); |         ); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Reference in a new issue
	
	 Lint Action
						Lint Action