zeroed-some/localtoast / 84c08fc

Browse files

satisfy tha linta

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
84c08fc3d0021a0d87ddfd17176f63e37aea0f66
Parents
22c5c99
Tree
e07ecfe

1 changed file

StatusFile+-
M frontend/lib/api.ts 6 4
frontend/lib/api.tsmodified
@@ -97,11 +97,13 @@ export const restaurantApi = {
9797
         params: { lat, lng, radius }
9898
       });
9999
       return response.data;
100
-    } catch (error: any) {
100
+    } catch (error) {
101101
       // Handle the bizarre 404-with-data issue from Railway
102
+      if (axios.isAxiosError(error)) {
102103
         if (error.response?.status === 404 && Array.isArray(error.response?.data)) {
103104
           console.warn('Got 404 with valid data - returning data anyway');
104
-        return error.response.data;
105
+          return error.response.data as PlaceSearchResult[];
106
+        }
105107
       }
106108
       throw error;
107109
     }