feat(SW-664): Hotel listing component and queries for content pages

This commit is contained in:
Erik Tiekstra
2024-12-11 14:46:38 +01:00
parent 118f1afafa
commit 3939bf7cdc
32 changed files with 989 additions and 140 deletions

View File

@@ -0,0 +1,24 @@
fragment HotelListing on HotelListing {
heading
location_filter {
city_denmark
city_finland
city_germany
city_norway
city_poland
city_sweden
country
excluded
}
manual_filter {
hotels
}
content_type
}
fragment HotelListing_ContentPage on ContentPageBlocksHotelListing {
__typename
hotel_listing {
...HotelListing
}
}

View File

@@ -4,6 +4,7 @@
#import "../../Fragments/Blocks/CardsGrid.graphql"
#import "../../Fragments/Blocks/Content.graphql"
#import "../../Fragments/Blocks/DynamicContent.graphql"
#import "../../Fragments/Blocks/HotelListing.graphql"
#import "../../Fragments/Blocks/Shortcuts.graphql"
#import "../../Fragments/Blocks/Table.graphql"
#import "../../Fragments/Blocks/TextCols.graphql"
@@ -65,6 +66,7 @@ query GetContentPageBlocksBatch2($locale: String!, $uid: String!) {
content_page(uid: $uid, locale: $locale) {
blocks {
__typename
...HotelListing_ContentPage
...Shortcuts_ContentPage
...Table_ContentPage
...TextCols_ContentPage

View File

@@ -0,0 +1,12 @@
#import "../../Fragments/System.graphql"
query GetHotelPageUrl($locale: String!, $hotelId: String!) {
all_hotel_page(locale: $locale, where: { hotel_page_id: $hotelId }) {
items {
url
system {
...System
}
}
}
}

View File

@@ -8,6 +8,7 @@ import type {
} from "@/types/requests/packages"
import type { Lang } from "@/constants/languages"
import type {
GetHotelsInput,
GetRoomsAvailabilityInput,
GetSelectedRoomAvailabilityInput,
HotelDataInput,
@@ -62,6 +63,12 @@ export const getUserTracking = cache(async function getMemoizedUserTracking() {
return serverClient().user.tracking()
})
export const getHotels = cache(async function getMemoizedHotels(
input: GetHotelsInput
) {
return serverClient().hotel.hotels.get(input)
})
export const getHotelData = cache(async function getMemoizedHotelData(
input: HotelDataInput
) {