feat: block all entries to enter details that miss the required params
This commit is contained in:
@@ -19,11 +19,6 @@ export default async function SummaryPage({
|
||||
const { hotel, adults, children, roomTypeCode, rateCode, fromDate, toDate } =
|
||||
getQueryParamsForEnterDetails(selectRoomParams)
|
||||
|
||||
if (!roomTypeCode || !rateCode) {
|
||||
console.log("No roomTypeCode or rateCode")
|
||||
return notFound()
|
||||
}
|
||||
|
||||
const availability = await getSelectedRoomAvailability({
|
||||
hotelId: parseInt(hotel),
|
||||
adults,
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { notFound, redirect } from "next/navigation"
|
||||
import { notFound } from "next/navigation"
|
||||
|
||||
import {
|
||||
getBreakfastPackages,
|
||||
getCreditCardsSafely,
|
||||
getHotelData,
|
||||
getProfileSafely,
|
||||
getRoomAvailability,
|
||||
getSelectedRoomAvailability,
|
||||
} from "@/lib/trpc/memoizedRequests"
|
||||
import { HotelIncludeEnum } from "@/server/routers/hotels/input"
|
||||
@@ -38,8 +37,6 @@ export default async function StepPage({
|
||||
}: PageArgs<LangParams & { step: StepEnum }, SelectRateSearchParams>) {
|
||||
const { lang } = params
|
||||
|
||||
void getBreakfastPackages(searchParams.hotel)
|
||||
|
||||
const intl = await getIntl()
|
||||
const selectRoomParams = new URLSearchParams(searchParams)
|
||||
const {
|
||||
@@ -52,10 +49,7 @@ export default async function StepPage({
|
||||
toDate,
|
||||
} = getQueryParamsForEnterDetails(selectRoomParams)
|
||||
|
||||
if (!rateCode || !roomTypeCode) {
|
||||
return notFound()
|
||||
}
|
||||
|
||||
void getBreakfastPackages(searchParams.hotel)
|
||||
void getSelectedRoomAvailability({
|
||||
hotelId: parseInt(searchParams.hotel),
|
||||
adults,
|
||||
|
||||
Reference in New Issue
Block a user