Merged in feat/SW-1454-listing-skeletons (pull request #1301)

Feat/SW-1454 listing skeletons

* feat(SW-1453): added skeleton for city listning

* feat(SW-1454): added skeleton for hotel listning


Approved-by: Fredrik Thorsson
This commit is contained in:
Erik Tiekstra
2025-02-11 12:05:44 +00:00
parent 967c776ab8
commit ff820d1f31
17 changed files with 325 additions and 135 deletions
@@ -8,6 +8,8 @@ import { contentStackUidWithServiceProcedure, router } from "@/server/trpc"
import { generateTag } from "@/utils/generateTag"
import { getHotelListData } from "../../hotels/utils"
import { getHotelListDataInput } from "./input"
import {
destinationCityPageRefsSchema,
destinationCityPageSchema,
@@ -20,7 +22,7 @@ import {
getDestinationCityPageRefsSuccessCounter,
getDestinationCityPageSuccessCounter,
} from "./telemetry"
import { generatePageTags, getHotelListData } from "./utils"
import { generatePageTags } from "./utils"
import type {
GetDestinationCityPageData,
@@ -147,12 +149,6 @@ export const destinationCityPageQueryRouter = router({
return null
}
const hotels = await getHotelListData(
lang,
serviceToken,
validatedResponse.data.destinationCityPage.destination_settings.city
)
getDestinationCityPageSuccessCounter.add(1, { lang, uid: `${uid}` })
console.info(
"contentstack.destinationCityPage success",
@@ -163,7 +159,18 @@ export const destinationCityPageQueryRouter = router({
return {
...validatedResponse.data,
hotels,
cityIdentifier:
validatedResponse.data.destinationCityPage.destination_settings.city,
}
}),
hotelList: contentStackUidWithServiceProcedure
.input(getHotelListDataInput)
.query(async ({ ctx, input }) => {
const { lang, serviceToken } = ctx
const { cityIdentifier } = input
const hotels = await getHotelListData(lang, serviceToken, cityIdentifier)
return hotels
}),
})