fix: redirect doen als een assignment is aangemaakt, idem voor delete
This commit is contained in:
parent
71e0c221a4
commit
85edb8feb5
3 changed files with 19 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted } from "vue";
|
||||
import {ref, computed, onMounted, watch} from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { useRouter } from "vue-router";
|
||||
import auth from "@/services/auth/auth-service.ts";
|
||||
|
@ -61,6 +61,11 @@
|
|||
}
|
||||
|
||||
const { mutate, isSuccess } = useDeleteAssignmentMutation();
|
||||
watch(isSuccess, async (success) => {
|
||||
if (success) {
|
||||
await router.push("/user/assignment");
|
||||
}
|
||||
});
|
||||
|
||||
async function goToDeleteAssignment(num: number, clsId: string): Promise<void> {
|
||||
mutate({
|
||||
|
@ -68,7 +73,6 @@
|
|||
an: num,
|
||||
});
|
||||
|
||||
if (isSuccess) await router.push("/user/assignment");
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue