small refactor
This commit is contained in:
@@ -260,10 +260,7 @@ export default function Home({ user, initialWorkflow, id, workflowAssignees, wor
|
|||||||
if (examModule && examId) {
|
if (examModule && examId) {
|
||||||
const exam = await getExamById(examModule, examId.trim());
|
const exam = await getExamById(examModule, examId.trim());
|
||||||
if (!exam) {
|
if (!exam) {
|
||||||
toast.error(
|
toast.error("Something went wrong while fetching exam!");
|
||||||
"Something went wrong while fetching exam!",
|
|
||||||
{ toastId: "invalid-exam-id" }
|
|
||||||
);
|
|
||||||
setViewExamIsLoading(false);
|
setViewExamIsLoading(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -272,13 +269,6 @@ export default function Home({ user, initialWorkflow, id, workflowAssignees, wor
|
|||||||
payload: { exams: [exam], modules: [examModule] },
|
payload: { exams: [exam], modules: [examModule] },
|
||||||
});
|
});
|
||||||
router.push("/exam");
|
router.push("/exam");
|
||||||
} else {
|
|
||||||
toast.error(
|
|
||||||
"Something went wrong while fetching exam!",
|
|
||||||
{ toastId: "invalid-exam-id" }
|
|
||||||
);
|
|
||||||
setViewExamIsLoading(false);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user