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" },
|
||||
]);
|
||||
|
||||
const { mutate, isSuccess } = useDeleteAssignmentMutation();
|
||||
watch(isSuccess, async (success) => {
|
||||
if (success) {
|
||||
await router.push("/user/assignment");
|
||||
}
|
||||
});
|
||||
const { mutate } = useDeleteAssignmentMutation();
|
||||
|
||||
async function deleteAssignment(num: number, clsId: string): Promise<void> {
|
||||
mutate({
|
||||
cid: clsId,
|
||||
an: num,
|
||||
});
|
||||
window.location.href = "/user/assignment";
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -64,11 +64,11 @@
|
|||
const { mutate } = useDeleteAssignmentMutation();
|
||||
|
||||
async function goToDeleteAssignment(num: number, clsId: string): Promise<void> {
|
||||
mutate({ cid: clsId, an: num }, {
|
||||
onSuccess: () => {
|
||||
deletedAssignments.value.add(num);
|
||||
},
|
||||
mutate({
|
||||
cid: clsId,
|
||||
an: num,
|
||||
});
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue