Skip to content
Snippets Groups Projects

merge: Update QuizService -> getRandomQuiz

Merged HUSS THEOPHILE requested to merge feature/140-get-random-quiz into develop
Compare and
1 file
+ 4
2
Preferences
Compare changes
+ 4
2
@@ -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 {