fix: move crunching of data to trpc layer
This commit is contained in:
@@ -3,6 +3,7 @@ import { cache } from "react"
|
||||
import { Lang } from "@/constants/languages"
|
||||
import {
|
||||
GetRoomsAvailabilityInput,
|
||||
GetSelectedRoomAvailabilityInput,
|
||||
HotelIncludeEnum,
|
||||
} from "@/server/routers/hotels/input"
|
||||
|
||||
@@ -95,6 +96,14 @@ export const getRoomAvailability = cache(
|
||||
}
|
||||
)
|
||||
|
||||
export const getSelectedRoomAvailability = cache(
|
||||
async function getMemoizedRoomAvailability(
|
||||
args: GetSelectedRoomAvailabilityInput
|
||||
) {
|
||||
return serverClient().hotel.availability.room(args)
|
||||
}
|
||||
)
|
||||
|
||||
export const getFooter = cache(async function getMemoizedFooter() {
|
||||
return serverClient().contentstack.base.footer()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user