fix: update BookingWidget type based on if hotelId is specified

This commit is contained in:
Arvid Norlin
2025-05-05 16:49:48 +02:00
committed by Michael Zetterberg
parent fa1ace9a2c
commit 77c9206a94

View File

@@ -36,7 +36,7 @@ export default function Form({ type, onClose }: BookingWidgetFormProps) {
const { handleSubmit, setValue } = useFormContext<BookingWidgetSchema>()
function onSubmit(data: BookingWidgetSchema) {
const type = data.city?.length ? "city" : "hotel"
const type = data.city && data.hotel ? "hotel" : "city"
const bookingFlowPage =
type === "city" ? selectHotel(lang) : selectRate(lang)