We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d6b838 commit 2aee811Copy full SHA for 2aee811
src/context.js
@@ -11,9 +11,6 @@ const API_ENDPOINT = "https://opentdb.com/api.php?";
11
12
const url = "";
13
14
-const tempUrl =
15
- "https://opentdb.com/api.php?amount=10&category=21&difficulty=easy&type=multiple";
16
-
17
const AppContext = React.createContext();
18
19
const AppProvider = ({ children }) => {
@@ -89,6 +86,10 @@ const AppProvider = ({ children }) => {
89
86
90
87
const handleSubmit = (event) => {
91
88
event.preventDefault();
+ const { amount, category, difficulty } = quiz;
+
+ const url = `${API_ENDPOINT}amount=${amount}&difficulty=${difficulty}&category=${table[category]}&type=multiple`;
92
+ fetchQuestions(url);
93
};
94
95
return (
0 commit comments