Skip to content

Commit

Permalink
Update Suggestions component to use number type for latitude and long…
Browse files Browse the repository at this point in the history
…itude
  • Loading branch information
remyvdwereld committed Jan 8, 2025
1 parent ec10300 commit c4c98fa
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Props> = ({ itineraryId, lat = "", lng = "" }) => {
const Suggestions: React.FC<Props> = ({ itineraryId, lat, lng }) => {
const { data: itinerary } = useItinerary(itineraryId)
const { data, isBusy } = useSuggestions(itineraryId, lat, lng)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const SuggestionsPage: React.FC = () => {
{ itineraryId && !isBusy && (
<Suggestions
itineraryId={ parseInt(itineraryId) }
lat={ location?.latitude.toString() }
lng={ location?.longitude.toString() }
lat={ location?.latitude }
lng={ location?.longitude }
/>
)}
</DefaultLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/app/state/rest/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit c4c98fa

Please sign in to comment.