this linter is mad as a mutha
Authored by
mfwolffe <wolffemf@dukes.jmu.edu>
- SHA
b83824c563e28c13d8926ee6b174c4f470767c27- Parents
-
7b8e987 - Tree
0e7640b
b83824c
b83824c563e28c13d8926ee6b174c4f470767c277b8e987
0e7640b| Status | File | + | - |
|---|---|---|---|
| M |
frontend/app/page.tsx
|
7 | 6 |
frontend/app/page.tsxmodified@@ -67,8 +67,8 @@ function HomePage() { | ||
| 67 | 67 | alert('Toast rating added! 🍞'); |
| 68 | 68 | }, |
| 69 | 69 | onError: (error: unknown) => { |
| 70 | - const err = error as any; | |
| 71 | - alert(err.response?.data?.error || 'Failed to add rating'); | |
| 70 | + const apiError = error as ApiError; | |
| 71 | + alert(apiError.response?.data?.error || 'Failed to add rating'); | |
| 72 | 72 | }, |
| 73 | 73 | }); |
| 74 | 74 | |
@@ -89,8 +89,8 @@ function HomePage() { | ||
| 89 | 89 | setSelectedRestaurant(null); // Close any open restaurant panel |
| 90 | 90 | }, |
| 91 | 91 | onError: (error: unknown) => { |
| 92 | - const err = error as any; | |
| 93 | - alert(err.response?.data?.error || 'Failed to search for places'); | |
| 92 | + const apiError = error as ApiError; | |
| 93 | + alert(apiError.response?.data?.error || 'Failed to search for places'); | |
| 94 | 94 | }, |
| 95 | 95 | }); |
| 96 | 96 | |
@@ -105,8 +105,9 @@ function HomePage() { | ||
| 105 | 105 | setRestaurants(updatedRestaurants); |
| 106 | 106 | } |
| 107 | 107 | }, |
| 108 | - onError: (error: ApiError) => { | |
| 109 | - alert(error.response?.data?.error || 'Failed to update toast status'); | |
| 108 | + onError: (error: unknown) => { | |
| 109 | + const apiError = error as ApiError; | |
| 110 | + alert(apiError.response?.data?.error || 'Failed to update toast status'); | |
| 110 | 111 | }, |
| 111 | 112 | }); |
| 112 | 113 | |