Updated and fixed part of the partial test generation

This commit is contained in:
Tiago Ribeiro
2024-01-23 11:45:32 +00:00
parent 74d3f30c93
commit bd0fab4c8f
8 changed files with 21 additions and 11 deletions

View File

@@ -19,8 +19,8 @@ const TaskTab = ({exam, setExam}: {exam?: LevelExam; setExam: (exam: LevelExam)
axios
.get(`/api/exam/level/generate/level`)
.then((result) => {
playSound("check");
console.log(result.data);
playSound(typeof result.data === "string" ? "error" : "check");
if (typeof result.data === "string") return toast.error("Something went wrong, please try to generate again.");
setExam(result.data);
})
.catch((error) => {