feat(SW-176): use temp data for hotel
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user