36 return c.json({
37 success: false,
38 error: "Failed to fetch spending trends"
39 }, 500);
40 }
15 return c.json({
16 success: false,
17 error: "Failed to fetch goals"
18 }, 500);
19 }
136 return c.json({
137 success: false,
138 error: "Failed to fetch travel destinations"
139 }, 500);
140 }
23 return c.json({
24 success: false,
25 error: "Failed to fetch expenses"
26 }, 500);
27 }
23 setLoading(true);
24 try {
25 const response = await fetch("/api/login", {
26 method: "POST",
27 headers: {
50 setLoading(true);
51 try {
52 const response = await fetch("/api/register", {
53 method: "POST",
54 headers: {
75 setLoading(true);
76 try {
77 await fetch("/api/logout", {
78 method: "POST",
79 });
155});
156
157export default app.fetch;
181
182 try {
183 const response = await fetch("/", {
184 method: "POST",
185 body: JSON.stringify({
3
4// This is the entry point for HTTP vals
5export default app.fetch;
11 return c.json(products);
12 } catch (error) {
13 console.error('Error fetching products:', error);
14 return c.json({ error: 'Failed to fetch products' }, 500);
15 }
16});
18
19 try {
20 const response = await fetch('/api/products');
21 if (!response.ok) {
22 throw new Error(`HTTP error! status: ${response.status}`);
73
74 try {
75 const response = await fetch('/api/purchase', {
76 method: 'POST',
77 headers: {
120 ].join(', ');
121
122 const response = await fetch(url, {
123 method: 'POST',
124 headers: {