182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({
114 }
115
116 const response = await fetch('/submit-vote', {
117 method: 'POST',
118 headers: { 'Content-Type': 'application/json' },
307
308 useEffect(() => {
309 async function fetchVotes() {
310 const response = await fetch('/get-votes');
311 const data = await response.json();
312 setVotes(data);
322 setLoading(false);
323 }
324 fetchVotes();
325 }, []);
326
327 const handleDeleteVote = async (id: number) => {
328 const response = await fetch('/delete-vote', {
329 method: 'POST',
330 headers: { 'Content-Type': 'application/json' },
76
77 try {
78 const response = await fetch("/api/generate-question", {
79 method: "POST",
80 headers: { "Content-Type": "application/json" },
106
107 try {
108 const response = await fetch("/api/generate-exam-questions", {
109 method: "POST",
110 headers: { "Content-Type": "application/json" },
143
144 try {
145 const response = await fetch("/api/get-feedback", {
146 method: "POST",
147 headers: { "Content-Type": "application/json" },
176
177 try {
178 const response = await fetch("/api/get-exam-feedback", {
179 method: "POST",
180 headers: { "Content-Type": "application/json" },
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({
9 try {
10 // Proxy the request to the Alquran Cloud API
11 const apiResponse = await fetch(apiUrl, {
12 method: request.method,
13 headers: {
41 });
42 } catch (error) {
43 // Handle any network or fetch errors
44 return new Response(
45 JSON.stringify({
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({