fix: improve loading on destination overview page

- Only load data from Contentstack
- Use static JSON for destination list
- Some logic improvements to data handling and types
This commit is contained in:
Michael Zetterberg
2025-03-26 11:38:10 +01:00
parent f010a6869a
commit 65f75c11ef
37 changed files with 6619 additions and 185 deletions

View File

@@ -1,4 +1,5 @@
import { CancellationRuleEnum } from "@/constants/booking"
import { Lang } from "@/constants/languages"
import { env } from "@/env/server"
import * as api from "@/lib/api"
import { dt } from "@/lib/dt"
@@ -79,7 +80,6 @@ import type {
} from "@/types/trpc/routers/hotel/availability"
import type { HotelInput } from "@/types/trpc/routers/hotel/hotel"
import type { CityLocation } from "@/types/trpc/routers/hotel/locations"
import type { Lang } from "@/constants/routes/hotelReservation"
export const getHotel = cache(
async (input: HotelInput, serviceToken: string) => {
@@ -1198,7 +1198,9 @@ export const hotelQueryRouter = router({
}) {
const lang = input?.lang ?? ctx.lang
const countries = await getCountries({
lang: lang,
// Countries need to be in English regardless of incoming lang because
// we use the names as input for API endpoints.
lang: Lang.en,
serviceToken: ctx.serviceToken,
})