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

:twisted_rightwards_arrows: merge merge: Update QuizService -> getRandomQuiz

Merge branch 'feature/140-get-random-quiz' into 'develop'
parents e034448c cd0abbfe
Branches
2 merge requests!133merge: Update QuizService -> getRandomQuiz,!132V4.0
Pipeline #325553 failed with stages
in 42 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