From 0ef12d4a29d24d6057a65fa8a2ebddd91266bd1d Mon Sep 17 00:00:00 2001 From: Pontus Dreij Date: Mon, 25 Nov 2024 15:38:08 +0100 Subject: [PATCH] fix(SW-1014): Fixed issue where google didn't found city. --- .../select-hotel/@modal/(.)map/page.tsx | 5 ++- .../(standard)/select-hotel/page.tsx | 5 +++ components/Maps/StaticMap/index.tsx | 5 ++- lib/trpc/memoizedRequests/index.ts | 5 ++- server/routers/hotels/input.ts | 3 ++ server/routers/hotels/query.ts | 35 +++++++++++++++---- types/components/maps/staticMap.ts | 1 + 7 files changed, 50 insertions(+), 9 deletions(-) diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/@modal/(.)map/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/@modal/(.)map/page.tsx index cdf236184..ea19ffda1 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/@modal/(.)map/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/@modal/(.)map/page.tsx @@ -58,7 +58,10 @@ export default async function SelectHotelMapPage({ const hotelPins = getHotelPins(hotels) const filterList = getFiltersFromHotels(hotels) - const cityCoordinates = await getCityCoordinates({ city: city.name }) + const cityCoordinates = await getCityCoordinates({ + city: city.name, + hotel: { address: hotels[0].hotelData.address.streetAddress }, + }) return ( diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/page.tsx index 49893c54d..3954be688 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/page.tsx @@ -51,8 +51,12 @@ export default async function SelectHotelPage({ (location) => location.name.toLowerCase() === searchParams.city.toLowerCase() ) + if (!city) return notFound() + const isCityWithCountry = (city: any): city is { country: string } => + "country" in city + const intl = await getIntl() const selectHotelParams = new URLSearchParams(searchParams) const selectHotelParamsObject = @@ -124,6 +128,7 @@ export default async function SelectHotelPage({