Merged in feat/SW-1451-country-page-sorting (pull request #1426)
Feat/SW-1451 country page filtering and sorting * feat(SW-1451): implemented sorting and filtering on country pages * feat(SW-1451): Renamed hotel-data to destination-data because of its multi-purpose use * feat(SW-1451): Now filtering after change of url instead of inside the store after submit Approved-by: Fredrik Thorsson
This commit is contained in:
@@ -18,7 +18,7 @@ import { generateTag } from "@/utils/generateTag"
|
||||
import { getHotel } from "../../hotels/query"
|
||||
import { getMetadataInput } from "./input"
|
||||
import { metadataSchema } from "./output"
|
||||
import { affix, getCityData } from "./utils"
|
||||
import { affix, getCityData, getCountryData } from "./utils"
|
||||
|
||||
import { PageContentTypeEnum } from "@/types/requests/contentType"
|
||||
import type { RawMetadataSchema } from "@/types/trpc/routers/contentstack/metadata"
|
||||
@@ -153,9 +153,16 @@ export const metadataQueryRouter = router({
|
||||
const destinationCountryPageResponse = await fetchMetadata<{
|
||||
destination_country_page: RawMetadataSchema
|
||||
}>(GetDestinationCountryPageMetadata, variables)
|
||||
return getTransformedMetadata(
|
||||
destinationCountryPageResponse.destination_country_page
|
||||
const countryData = await getCountryData(
|
||||
destinationCountryPageResponse.destination_country_page,
|
||||
input,
|
||||
ctx.serviceToken,
|
||||
ctx.lang
|
||||
)
|
||||
return getTransformedMetadata({
|
||||
...destinationCountryPageResponse.destination_country_page,
|
||||
...countryData,
|
||||
})
|
||||
case PageContentTypeEnum.destinationCityPage:
|
||||
const destinationCityPageResponse = await fetchMetadata<{
|
||||
destination_city_page: RawMetadataSchema
|
||||
|
||||
Reference in New Issue
Block a user