feat(SW-176): use temp data for hotel

This commit is contained in:
Fredrik Thorsson
2024-08-30 11:50:37 +02:00
parent ad0f42a90d
commit fa6108d718
2 changed files with 5 additions and 9 deletions

View File

@@ -1,4 +1,5 @@
import { serverClient } from "@/lib/trpc/server" import { serverClient } from "@/lib/trpc/server"
import tempHotelData from "@/server/routers/hotels/tempHotelData.json"
import { mapFacilityToIcon } from "@/components/ContentType/HotelPage/data" import { mapFacilityToIcon } from "@/components/ContentType/HotelPage/data"
import { import {
@@ -29,14 +30,8 @@ export default async function HotelCard({
}: HotelCardProps) { }: HotelCardProps) {
const intl = await getIntl() const intl = await getIntl()
const hotelResponse = await serverClient().hotel.get({ // TODO: Use real endpoint.
hotelId: hotelId.toString(), const hotel = tempHotelData.data.attributes
language: getLang(),
})
if (!hotelResponse) return null
const { hotel } = hotelResponse
const sortedAmenities = hotel.detailedFacilities const sortedAmenities = hotel.detailedFacilities
.sort((a, b) => b.sortOrder - a.sortOrder) .sort((a, b) => b.sortOrder - a.sortOrder)

View File

@@ -8,12 +8,13 @@ import {
notFound, notFound,
serverErrorByStatus, serverErrorByStatus,
} from "@/server/errors/trpc" } from "@/server/errors/trpc"
import { extractHotelImages } from "@/server/routers/utils/hotels"
import { import {
contentStackUidWithServiceProcedure, contentStackUidWithServiceProcedure,
publicProcedure, publicProcedure,
router, router,
serviceProcedure,
} from "@/server/trpc" } from "@/server/trpc"
import { extractHotelImages } from "@/server/routers/utils/hotels"
import { toApiLang } from "@/server/utils" import { toApiLang } from "@/server/utils"
import { import {