Skip to content
Snippets Groups Projects
Commit cd0abbfe authored by HUSS THEOPHILE's avatar HUSS THEOPHILE
Browse files

feat: Update QuizService -> getRandomQuiz

parent e034448c
Branches
2 merge requests!133merge: Update QuizService -> getRandomQuiz,!132V4.0
Pipeline #325536 passed with stages
in 19 seconds
......@@ -184,10 +184,12 @@ export const useQuizService = () => {
};
const getRandomQuiz = async (): Promise<QuizGenerateAnswer | HttpError> => {
const categories = await getCategories();
const difficulties = ['easy', 'medium', 'hard'];
const requestBody = {
amount: 10,
category: 10,
difficulty: "easy",
category: categories[Math.floor(Math.random() * categories.length)].id,
difficulty: difficulties[Math.floor(Math.random() * difficulties.length)],
};
try {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment