fix: preload requests to avoid needing to promise.all
This commit is contained in:
@@ -24,18 +24,16 @@ export default async function SummaryPage({
|
||||
return notFound()
|
||||
}
|
||||
|
||||
const [user, availability] = await Promise.all([
|
||||
getProfileSafely(),
|
||||
getSelectedRoomAvailability({
|
||||
hotelId: parseInt(hotel),
|
||||
adults,
|
||||
children,
|
||||
roomStayStartDate: fromDate,
|
||||
roomStayEndDate: toDate,
|
||||
rateCode,
|
||||
roomTypeCode,
|
||||
}),
|
||||
])
|
||||
const availability = await getSelectedRoomAvailability({
|
||||
hotelId: parseInt(hotel),
|
||||
adults,
|
||||
children,
|
||||
roomStayStartDate: fromDate,
|
||||
roomStayEndDate: toDate,
|
||||
rateCode,
|
||||
roomTypeCode,
|
||||
})
|
||||
const user = await getProfileSafely()
|
||||
|
||||
if (!availability) {
|
||||
console.error("No hotel or availability data", availability)
|
||||
|
||||
Reference in New Issue
Block a user