feat(SW-664): Hotel listing component and queries for content pages
This commit is contained in:
24
lib/graphql/Fragments/Blocks/HotelListing.graphql
Normal file
24
lib/graphql/Fragments/Blocks/HotelListing.graphql
Normal 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
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
12
lib/graphql/Query/HotelPage/HotelPageUrl.graphql
Normal file
12
lib/graphql/Query/HotelPage/HotelPageUrl.graphql
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user