Go to select hotel when booking widget submits

This commit is contained in:
Niclas Edenvin
2024-09-02 10:20:55 +02:00
parent 0ab825278c
commit bb9b457525

View File

@@ -1,5 +1,6 @@
"use client"
import { zodResolver } from "@hookform/resolvers/zod"
import { useRouter } from "next/navigation"
import { FormProvider, useForm } from "react-hook-form"
import { useIntl } from "react-intl"
@@ -19,6 +20,7 @@ const formId = "booking-widget"
export default function Form() {
const intl = useIntl()
const router = useRouter()
const methods = useForm<BookingWidgetSchema>({
defaultValues: {
search: {
@@ -48,8 +50,9 @@ export default function Form() {
function onSubmit(data: BookingWidgetSchema) {
console.log(data)
// Parse data and route accordignly to Select hotel or select room-rate page
// TODO: Parse data and route accordignly to Select hotel or select room-rate page
console.log("to be routing")
router.push("/en/hotelreservation/select-hotel")
}
return (