MCPcopy Create free account
hub / github.com/Bitbox-Connect/Bitbox / fetchQuestions

Function fetchQuestions

client/src/component/DiscussionForum.jsx:11–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9 // Fetch questions from the backend API
10 useEffect(() => {
11 const fetchQuestions = async () => {
12 try {
13 const response = await fetch(`${VITE_SERVER_PORT}/api/discussion/getQuestion`);
14 if (response.ok) {
15 const data = await response.json();
16 setQuestions(data);
17 } else {
18 console.error('Failed to fetch questions');
19 }
20 } catch (error) {
21 console.error('Error fetching questions:', error);
22 }
23 };
24
25 fetchQuestions();
26

Callers 1

DiscussionForumFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected