fix: update BookingWidget type based on if hotelId is specified
This commit is contained in:
committed by
Michael Zetterberg
parent
fa1ace9a2c
commit
77c9206a94
@@ -36,7 +36,7 @@ export default function Form({ type, onClose }: BookingWidgetFormProps) {
|
|||||||
const { handleSubmit, setValue } = useFormContext<BookingWidgetSchema>()
|
const { handleSubmit, setValue } = useFormContext<BookingWidgetSchema>()
|
||||||
|
|
||||||
function onSubmit(data: BookingWidgetSchema) {
|
function onSubmit(data: BookingWidgetSchema) {
|
||||||
const type = data.city?.length ? "city" : "hotel"
|
const type = data.city && data.hotel ? "hotel" : "city"
|
||||||
|
|
||||||
const bookingFlowPage =
|
const bookingFlowPage =
|
||||||
type === "city" ? selectHotel(lang) : selectRate(lang)
|
type === "city" ? selectHotel(lang) : selectRate(lang)
|
||||||
|
|||||||
Reference in New Issue
Block a user