This commit is contained in:
Linus Flood
2024-11-05 13:51:10 +01:00
parent 7e4bbfb3e6
commit ae2601bef8
4 changed files with 29 additions and 81 deletions

View File

@@ -1,3 +1,4 @@
import { getHotelData } from "@/lib/trpc/memoizedRequests"
import { serverClient } from "@/lib/trpc/server"
import { getLang } from "@/i18n/serverContext"
@@ -15,7 +16,7 @@ export async function fetchAvailableHotels(
const language = getLang()
const hotels = availableHotels.availability.map(async (hotel) => {
const hotelData = await serverClient().hotel.hotelData.get({
const hotelData = await getHotelData({
hotelId: hotel.hotelId.toString(),
language,
})

View File

@@ -1,7 +1,11 @@
import { notFound } from "next/navigation"
import { dt } from "@/lib/dt"
import { getLocations, getProfileSafely } from "@/lib/trpc/memoizedRequests"
import {
getHotelData,
getLocations,
getProfileSafely,
} from "@/lib/trpc/memoizedRequests"
import { serverClient } from "@/lib/trpc/server"
import { HotelIncludeEnum } from "@/server/routers/hotels/input"
@@ -58,10 +62,7 @@ export default async function SelectRatePage({
: undefined // TODO: Handle multiple rooms
const [hotelData, roomsAvailability, packages, user] = await Promise.all([
serverClient().hotel.hotelData.get({
hotelId: searchParams.hotel,
language: params.lang,
}),
getHotelData({ hotelId: searchParams.hotel, language: params.lang }),
serverClient().hotel.availability.rooms({
hotelId: parseInt(searchParams.hotel, 10),
roomStayStartDate: validFromDate,