fix: move packages schemas
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import {
|
||||
getPackages,
|
||||
getProfileSafely,
|
||||
getSelectedRoomAvailability,
|
||||
} from "@/lib/trpc/memoizedRequests"
|
||||
@@ -22,7 +23,13 @@ export default async function SummaryPage({
|
||||
const { hotel, rooms, fromDate, toDate } =
|
||||
getQueryParamsForEnterDetails(selectRoomParams)
|
||||
|
||||
const { adults, children, roomTypeCode, rateCode } = rooms[0] // TODO: Handle multiple rooms
|
||||
const {
|
||||
adults,
|
||||
children,
|
||||
roomTypeCode,
|
||||
rateCode,
|
||||
packages: packageCodes,
|
||||
} = rooms[0] // TODO: Handle multiple rooms
|
||||
|
||||
const availability = await getSelectedRoomAvailability({
|
||||
hotelId: hotel,
|
||||
@@ -34,6 +41,14 @@ export default async function SummaryPage({
|
||||
roomTypeCode,
|
||||
})
|
||||
const user = await getProfileSafely()
|
||||
const packages = await getPackages({
|
||||
hotelId: hotel,
|
||||
startDate: fromDate,
|
||||
endDate: toDate,
|
||||
adults,
|
||||
children: children?.length,
|
||||
packageCodes,
|
||||
})
|
||||
|
||||
if (!availability) {
|
||||
console.error("No hotel or availability data", availability)
|
||||
@@ -64,6 +79,7 @@ export default async function SummaryPage({
|
||||
},
|
||||
}
|
||||
|
||||
console.log({ packages })
|
||||
return (
|
||||
<>
|
||||
<div className={styles.mobileSummary}>
|
||||
|
||||
Reference in New Issue
Block a user