@@ -67,8 +67,8 @@ function HomePage() { |
| 67 | alert('Toast rating added! 🍞'); | 67 | alert('Toast rating added! 🍞'); |
| 68 | }, | 68 | }, |
| 69 | onError: (error: unknown) => { | 69 | onError: (error: unknown) => { |
| 70 | - const err = error as any; | 70 | + const apiError = error as ApiError; |
| 71 | - alert(err.response?.data?.error || 'Failed to add rating'); | 71 | + alert(apiError.response?.data?.error || 'Failed to add rating'); |
| 72 | }, | 72 | }, |
| 73 | }); | 73 | }); |
| 74 | | 74 | |
@@ -89,8 +89,8 @@ function HomePage() { |
| 89 | setSelectedRestaurant(null); // Close any open restaurant panel | 89 | setSelectedRestaurant(null); // Close any open restaurant panel |
| 90 | }, | 90 | }, |
| 91 | onError: (error: unknown) => { | 91 | onError: (error: unknown) => { |
| 92 | - const err = error as any; | 92 | + const apiError = error as ApiError; |
| 93 | - alert(err.response?.data?.error || 'Failed to search for places'); | 93 | + alert(apiError.response?.data?.error || 'Failed to search for places'); |
| 94 | }, | 94 | }, |
| 95 | }); | 95 | }); |
| 96 | | 96 | |
@@ -105,8 +105,9 @@ function HomePage() { |
| 105 | setRestaurants(updatedRestaurants); | 105 | setRestaurants(updatedRestaurants); |
| 106 | } | 106 | } |
| 107 | }, | 107 | }, |
| 108 | - onError: (error: ApiError) => { | 108 | + onError: (error: unknown) => { |
| 109 | - alert(error.response?.data?.error || 'Failed to update toast status'); | 109 | + const apiError = error as ApiError; |
| | 110 | + alert(apiError.response?.data?.error || 'Failed to update toast status'); |
| 110 | }, | 111 | }, |
| 111 | }); | 112 | }); |
| 112 | | 113 | |