fix(SW-1446): use existing functions for url data
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user