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

@@ -21,7 +21,8 @@ const PartTab = ({part, index, setPart}: {part?: SpeakingPart; index: number; se
axios
.get(`/api/exam/speaking/generate/speaking_task_${index}`)
.then((result) => {
playSound("check");
playSound(typeof result.data === "string" ? "error" : "check");
if (typeof result.data === "string") return toast.error("Something went wrong, please try to generate again.");
setPart(result.data);
})
.catch((error) => {