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:
@@ -4,11 +4,16 @@ import {
|
||||
} from "@/lib/graphql/Query/DestinationCountryPage/DestinationCountryPage.graphql"
|
||||
import { request } from "@/lib/graphql/request"
|
||||
import { notFound } from "@/server/errors/trpc"
|
||||
import { contentStackUidWithServiceProcedure, router } from "@/server/trpc"
|
||||
import {
|
||||
contentStackBaseWithServiceProcedure,
|
||||
contentStackUidWithServiceProcedure,
|
||||
router,
|
||||
} from "@/server/trpc"
|
||||
import { toApiLang } from "@/server/utils"
|
||||
|
||||
import { generateTag } from "@/utils/generateTag"
|
||||
|
||||
import { getCityPagesInput } from "./input"
|
||||
import {
|
||||
destinationCountryPageRefsSchema,
|
||||
destinationCountryPageSchema,
|
||||
@@ -151,12 +156,8 @@ export const destinationCountryPageQueryRouter = router({
|
||||
)
|
||||
return null
|
||||
}
|
||||
|
||||
const cities = await getCityPages(
|
||||
lang,
|
||||
serviceToken,
|
||||
const country =
|
||||
validatedResponse.data.destinationCountryPage.destination_settings.country
|
||||
)
|
||||
|
||||
getDestinationCountryPageSuccessCounter.add(1, { lang, uid: `${uid}` })
|
||||
console.info(
|
||||
@@ -168,12 +169,17 @@ export const destinationCountryPageQueryRouter = router({
|
||||
|
||||
return {
|
||||
...validatedResponse.data,
|
||||
translatedCountry:
|
||||
ApiCountry[lang][
|
||||
validatedResponse.data.destinationCountryPage.destination_settings
|
||||
.country
|
||||
],
|
||||
cities,
|
||||
translatedCountry: ApiCountry[lang][country],
|
||||
}
|
||||
}),
|
||||
cityPages: contentStackBaseWithServiceProcedure
|
||||
.input(getCityPagesInput)
|
||||
.query(async ({ ctx, input }) => {
|
||||
const { lang, serviceToken } = ctx
|
||||
const { country } = input
|
||||
|
||||
const cities = await getCityPages(lang, serviceToken, country)
|
||||
|
||||
return cities
|
||||
}),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user