zeroed-some/localtoast / 560003e

Browse files

satisfy the linter

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
560003e9158bafe8998e035f21230afbf7c42a79
Parents
a04af33
Tree
a8c5f96

5 changed files

StatusFile+-
M frontend/app/page.tsx 8 7
M frontend/components/Map.tsx 1 1
M frontend/components/RestaurantPanel.tsx 1 1
M frontend/components/ReviewModal.tsx 1 1
M frontend/components/SearchPanel.tsx 1 1
frontend/app/page.tsxmodified
@@ -2,8 +2,8 @@
22
 
33
 import { useState, useEffect } from 'react';
44
 import dynamic from 'next/dynamic';
5
-import { MapPin, Plus, Loader2 } from 'lucide-react';
6
-import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
5
+import { Plus, Loader2 } from 'lucide-react';
6
+import { useMutation } from '@tanstack/react-query';
77
 import { Providers } from './providers';
88
 import { Loading } from '@/components/Loading';
99
 import ReviewModal from '@/components/ReviewModal';
@@ -23,7 +23,6 @@ function HomePage() {
2323
   const [searchResultsMinimized, setSearchResultsMinimized] = useState(false);
2424
   const [searchResults, setSearchResults] = useState<PlaceSearchResult[]>([]);
2525
   const [restaurants, setRestaurants] = useState<Restaurant[]>([]);
26
-  const queryClient = useQueryClient();
2726
 
2827
   // Get user's location
2928
   useEffect(() => {
@@ -58,8 +57,9 @@ function HomePage() {
5857
       }
5958
       alert('Toast rating added! 🍞');
6059
     },
61
-    onError: (error: any) => {
62
-      alert(error.response?.data?.error || 'Failed to add rating');
60
+    onError: (error: unknown) => {
61
+      const err = error as any;
62
+      alert(err.response?.data?.error || 'Failed to add rating');
6363
     },
6464
   });
6565
 
@@ -79,8 +79,9 @@ function HomePage() {
7979
       setShowSearchResults(true);
8080
       setSelectedRestaurant(null); // Close any open restaurant panel
8181
     },
82
-    onError: () => {
83
-      alert('Failed to search for places');
82
+    onError: (error: unknown) => {
83
+      const err = error as any;
84
+      alert(err.response?.data?.error || 'Failed to search for places');
8485
     },
8586
   });
8687
 
frontend/components/Map.tsxmodified
@@ -9,7 +9,7 @@ import { Restaurant } from '@/lib/api';
99
 
1010
 // Fix for default markers in React-Leaflet
1111
 if (typeof window !== 'undefined') {
12
-  delete (L.Icon.Default.prototype as any)._getIconUrl;
12
+  delete (L.Icon.Default.prototype as Record<string, any>)._getIconUrl;
1313
   L.Icon.Default.mergeOptions({
1414
     iconRetinaUrl: '/leaflet/marker-icon-2x.png',
1515
     iconUrl: '/leaflet/marker-icon.png',
frontend/components/RestaurantPanel.tsxmodified
@@ -26,7 +26,7 @@ export default function RestaurantPanel({ restaurant, onClose, onAddRating }: Re
2626
       setShowRatingForm(false);
2727
       setRating(5);
2828
       setReview('');
29
-    } catch (error) {
29
+    } catch (_error) {
3030
       // Error handling done in parent
3131
     } finally {
3232
       setIsSubmitting(false);
frontend/components/ReviewModal.tsxmodified
@@ -23,7 +23,7 @@ export default function ReviewModal({ restaurant, onClose, onSubmit }: ReviewMod
2323
     try {
2424
       await onSubmit({ rating, review });
2525
       onClose();
26
-    } catch (error) {
26
+    } catch {
2727
       // Error handling done in parent
2828
     } finally {
2929
       setIsSubmitting(false);
frontend/components/SearchPanel.tsxmodified
@@ -1,7 +1,7 @@
11
 'use client';
22
 
33
 import { useState } from 'react';
4
-import { X, ThumbsUp, ThumbsDown, MessageSquare, MapPin, Star } from 'lucide-react';
4
+import { ThumbsUp, ThumbsDown, MessageSquare, MapPin } from 'lucide-react';
55
 import { PlaceSearchResult } from '@/lib/api';
66
 
77
 interface SearchPanelProps {