From c4c98fa4211f73b087b8ff1194c75e737c175182 Mon Sep 17 00:00:00 2001 From: Remy van der Wereld Date: Wed, 8 Jan 2025 10:47:02 +0100 Subject: [PATCH] Update Suggestions component to use number type for latitude and longitude --- .../components/pages/suggestions/Suggestions.tsx | 6 +++--- .../components/pages/suggestions/SuggestionsPage.tsx | 4 ++-- .../features/shared/hooks/useGeoLocation/useGeoLocation.ts | 2 +- src/app/state/rest/index.ts | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/app/features/itineraries/components/pages/suggestions/Suggestions.tsx b/src/app/features/itineraries/components/pages/suggestions/Suggestions.tsx index 00e7901e1..0a6610a5d 100644 --- a/src/app/features/itineraries/components/pages/suggestions/Suggestions.tsx +++ b/src/app/features/itineraries/components/pages/suggestions/Suggestions.tsx @@ -7,11 +7,11 @@ import CenteredSpinner from "app/features/shared/components/atoms/CenteredSpinne type Props = { itineraryId: number - lat?: string - lng?: string + lat?: number + lng?: number } -const Suggestions: React.FC = ({ itineraryId, lat = "", lng = "" }) => { +const Suggestions: React.FC = ({ itineraryId, lat, lng }) => { const { data: itinerary } = useItinerary(itineraryId) const { data, isBusy } = useSuggestions(itineraryId, lat, lng) diff --git a/src/app/features/itineraries/components/pages/suggestions/SuggestionsPage.tsx b/src/app/features/itineraries/components/pages/suggestions/SuggestionsPage.tsx index 464a72415..a4f956d98 100644 --- a/src/app/features/itineraries/components/pages/suggestions/SuggestionsPage.tsx +++ b/src/app/features/itineraries/components/pages/suggestions/SuggestionsPage.tsx @@ -21,8 +21,8 @@ const SuggestionsPage: React.FC = () => { { itineraryId && !isBusy && ( )} diff --git a/src/app/features/shared/hooks/useGeoLocation/useGeoLocation.ts b/src/app/features/shared/hooks/useGeoLocation/useGeoLocation.ts index 6e13662ea..9eea4ccbc 100644 --- a/src/app/features/shared/hooks/useGeoLocation/useGeoLocation.ts +++ b/src/app/features/shared/hooks/useGeoLocation/useGeoLocation.ts @@ -28,7 +28,7 @@ export const useGeoLocation = (): UseLocationReturn => { setLocation({ latitude, longitude }) }, (err) => { - console.log("TOP:", err.message) + console.log("TOP error geolocation:", err.message) }, { enableHighAccuracy: true, // Use high accuracy if available diff --git a/src/app/state/rest/index.ts b/src/app/state/rest/index.ts index 8c57f2bda..013c0f44c 100644 --- a/src/app/state/rest/index.ts +++ b/src/app/state/rest/index.ts @@ -66,8 +66,8 @@ export const useItineraryItem = (id: number | string, options?: Options) => { export const useSuggestions = ( itineraryId: number, - lat?: string, - lng?: string, + lat?: number, + lng?: number, options?: Options ) => { const handleError = useErrorHandler()