fix: kleine fixes
This commit is contained in:
parent
0abe9b1bce
commit
7f1c66c757
5 changed files with 131 additions and 44 deletions
|
@ -3,6 +3,7 @@
|
|||
import UsingQueryResult from "@/components/UsingQueryResult.vue";
|
||||
import { useAssignmentSubmissionsQuery } from "@/queries/assignments.ts";
|
||||
import type { SubmissionsResponse } from "@/controllers/submissions.ts";
|
||||
import {watch} from "vue";
|
||||
|
||||
const props = defineProps<{
|
||||
group: object;
|
||||
|
@ -11,6 +12,8 @@
|
|||
goToGroupSubmissionLink: (groupNo: number) => void;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<(e: "update:hasSubmission", hasSubmission: boolean) => void>();
|
||||
|
||||
const { t } = useI18n();
|
||||
const submissionsQuery = useAssignmentSubmissionsQuery(
|
||||
() => props.classId,
|
||||
|
@ -18,6 +21,16 @@
|
|||
() => props.group.originalGroupNo,
|
||||
() => true,
|
||||
);
|
||||
|
||||
watch(
|
||||
() => submissionsQuery.data.value,
|
||||
(data) => {
|
||||
if (data) {
|
||||
emit("update:hasSubmission", data.submissions.length > 0);
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue