fix(SW-1446): use existing functions for url data

This commit is contained in:
Michael Zetterberg
2025-04-04 13:27:40 +02:00
parent 9e84da45bc
commit 4aeb5b071d
6 changed files with 72 additions and 98 deletions

View File

@@ -1,21 +0,0 @@
query GetLocationsUrls($locale: String!) {
hotels: all_hotel_page(locale: $locale) {
items {
url
id: hotel_page_id
}
}
cities: all_destination_city_page {
items {
url
id: destination_settings {
sv: city_sweden
pl: city_poland
no: city_norway
de: city_germany
fi: city_finland
da: city_denmark
}
}
}
}

View File

@@ -301,13 +301,13 @@ export const getJumpToData = cache(async function getMemoizedJumpToData() {
if (isCity) {
url = urls.cities.find(
(c) =>
c.id &&
c.city &&
location.cityIdentifier &&
c.id === location.cityIdentifier
c.city === location.cityIdentifier
)?.url
} else if (isHotel) {
url = urls.hotels.find(
(h) => h.id && location.id && h.id === location.id
(h) => h.hotelId && location.id && h.hotelId === location.id
)?.url
}