style: fix linting issues met Prettier
This commit is contained in:
parent
9393898e06
commit
455ad82ce7
4 changed files with 12 additions and 13 deletions
|
@ -90,8 +90,7 @@ export async function createQuestion(loId: LearningObjectIdentifier, questionDat
|
||||||
let assignment;
|
let assignment;
|
||||||
|
|
||||||
if (typeof questionData.inGroup.assignment === 'number' && typeof questionData.inGroup.class === 'string') {
|
if (typeof questionData.inGroup.assignment === 'number' && typeof questionData.inGroup.class === 'string') {
|
||||||
assignment = await fetchAssignment(questionData.inGroup.class,
|
assignment = await fetchAssignment(questionData.inGroup.class, questionData.inGroup.assignment);
|
||||||
questionData.inGroup.assignment);
|
|
||||||
} else {
|
} else {
|
||||||
// TODO check if necessary and no conflicts to delete this if
|
// TODO check if necessary and no conflicts to delete this if
|
||||||
const clazz = await getClassRepository().findById((questionData.inGroup.assignment as AssignmentDTO).within);
|
const clazz = await getClassRepository().findById((questionData.inGroup.assignment as AssignmentDTO).within);
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { LearningObject } from "@/data-objects/learning-objects/learning-object";
|
import type { LearningObject } from "@/data-objects/learning-objects/learning-object";
|
||||||
import { useQuestionsQuery } from "@/queries/questions";
|
import { useQuestionsQuery } from "@/queries/questions";
|
||||||
import type { LearningObjectIdentifierDTO } from "@dwengo-1/common/interfaces/learning-content";
|
import type { LearningObjectIdentifierDTO } from "@dwengo-1/common/interfaces/learning-content";
|
||||||
import { computed } from 'vue';
|
import { computed } from "vue";
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
node: LearningObject;
|
node: LearningObject;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const loid = {
|
const loid = {
|
||||||
hruid: props.node.key,
|
hruid: props.node.key,
|
||||||
version: props.node.version,
|
version: props.node.version,
|
||||||
language: props.node.language,} as LearningObjectIdentifierDTO;
|
language: props.node.language,
|
||||||
const { data } = useQuestionsQuery(loid);
|
} as LearningObjectIdentifierDTO;
|
||||||
|
const { data } = useQuestionsQuery(loid);
|
||||||
|
|
||||||
const hasQuestions = computed(() => (data.value?.questions.length ?? 0) > 0);
|
const hasQuestions = computed(() => (data.value?.questions.length ?? 0) > 0);
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<template v-if="!isLoading & !error">
|
<template v-if="!isLoading & !error">
|
||||||
<v-icon
|
<v-icon
|
||||||
|
|
|
@ -13,11 +13,11 @@
|
||||||
|
|
||||||
const expanded = ref(false);
|
const expanded = ref(false);
|
||||||
|
|
||||||
function toggle (): void {
|
function toggle(): void {
|
||||||
expanded.value = !expanded.value;
|
expanded.value = !expanded.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatDate (timestamp: string | Date): string {
|
function formatDate(timestamp: string | Date): string {
|
||||||
return new Date(timestamp).toLocaleString();
|
return new Date(timestamp).toLocaleString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -176,7 +176,7 @@
|
||||||
author: authService.authState.user?.profile.preferred_username,
|
author: authService.authState.user?.profile.preferred_username,
|
||||||
content: questionInput.value,
|
content: questionInput.value,
|
||||||
inGroup: group, //TODO: POST response zegt dat dit null is???
|
inGroup: group, //TODO: POST response zegt dat dit null is???
|
||||||
}
|
};
|
||||||
if (questionInput.value !== "") {
|
if (questionInput.value !== "") {
|
||||||
createQuestionMutation.mutate(questionData, {
|
createQuestionMutation.mutate(questionData, {
|
||||||
onSuccess: async () => {
|
onSuccess: async () => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue