feat: pagina wordt gerefreshed na het verwijderen van een assignment
This commit is contained in:
parent
a963cf472c
commit
8e97c10f65
2 changed files with 7 additions and 10 deletions
|
@ -71,18 +71,15 @@ Const {groupProgressMap} = props.useGroupsWithProgress(
|
||||||
{ title: t("submission"), align: "center", key: "submission" },
|
{ title: t("submission"), align: "center", key: "submission" },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const { mutate, isSuccess } = useDeleteAssignmentMutation();
|
const { mutate } = useDeleteAssignmentMutation();
|
||||||
watch(isSuccess, async (success) => {
|
|
||||||
if (success) {
|
|
||||||
await router.push("/user/assignment");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
async function deleteAssignment(num: number, clsId: string): Promise<void> {
|
async function deleteAssignment(num: number, clsId: string): Promise<void> {
|
||||||
mutate({
|
mutate({
|
||||||
cid: clsId,
|
cid: clsId,
|
||||||
an: num,
|
an: num,
|
||||||
});
|
});
|
||||||
|
window.location.href = "/user/assignment";
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -64,11 +64,11 @@
|
||||||
const { mutate } = useDeleteAssignmentMutation();
|
const { mutate } = useDeleteAssignmentMutation();
|
||||||
|
|
||||||
async function goToDeleteAssignment(num: number, clsId: string): Promise<void> {
|
async function goToDeleteAssignment(num: number, clsId: string): Promise<void> {
|
||||||
mutate({ cid: clsId, an: num }, {
|
mutate({
|
||||||
onSuccess: () => {
|
cid: clsId,
|
||||||
deletedAssignments.value.add(num);
|
an: num,
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
window.location.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue