16 lines
381 B
TypeScript
16 lines
381 B
TypeScript
import { cache } from "react"
|
|
|
|
import { serverClient } from "../../trpc"
|
|
|
|
import type { HotelInput } from "@scandic-hotels/trpc/types/hotel"
|
|
|
|
export const getHotel = cache(async function getMemoizedHotelData(
|
|
input: HotelInput
|
|
) {
|
|
if (!input.isCardOnlyPayment) {
|
|
input.isCardOnlyPayment = false
|
|
}
|
|
const caller = await serverClient()
|
|
return caller.hotel.get(input)
|
|
})
|