sub-task: SW-685 Optimized params

This commit is contained in:
Hrishikesh Vaipurkar
2024-10-28 12:04:17 +01:00
parent 05d353e224
commit 24384c08f3
3 changed files with 3 additions and 8 deletions

View File

@@ -3,11 +3,11 @@ import { serverClient } from "@/lib/trpc/server"
import BookingWidget, { preload } from "@/components/BookingWidget"
import { BookingWidgetPageProps } from "@/types/components/bookingWidget"
import { PageArgs } from "@/types/params"
export default async function BookingWidgetPage({
searchParams,
}: BookingWidgetPageProps) {
}: PageArgs<{}, URLSearchParams>) {
if (env.HIDE_FOR_NEXT_RELEASE) {
return null
}

View File

@@ -26,7 +26,7 @@ export const bookingwidgetQueryRouter = router({
const failedResponse = { hideBookingWidget: false }
const { contentType, uid, lang } = ctx
// This condition is to handle 404 page case
// This condition is to handle 404 page case and booking flow
if (!contentType || !uid) {
console.log("No proper params defined: ", contentType, uid)
return failedResponse

View File

@@ -16,17 +16,12 @@ export type BookingWidgetSearchParams = {
fromDate?: string
toDate?: string
room?: GuestsRoom[]
[key: string]: string | string[] | GuestsRoom[] | undefined
}
export type BookingWidgetType = VariantProps<
typeof bookingWidgetVariants
>["type"]
export interface BookingWidgetPageProps {
searchParams?: URLSearchParams
}
export interface BookingWidgetProps {
type?: BookingWidgetType
searchParams?: URLSearchParams