feat: SW-1583 City search Map view redemption

This commit is contained in:
Hrishikesh Vaipurkar
2025-03-05 19:08:54 +01:00
parent f6db5f2732
commit 23eaa772ea
11 changed files with 72 additions and 16 deletions

View File

@@ -37,6 +37,7 @@ export default function BookingCode() {
setValue,
formState: { errors },
getValues,
trigger,
} = useFormContext<BookingWidgetSchema>()
const bookingCode: BookingCodeSchema = getValues("bookingCode")
@@ -52,6 +53,12 @@ export default function BookingCode() {
function updateBookingCodeFormValue(value: string) {
setValue("bookingCode.value", value, { shouldValidate: true })
if (getValues("redemption")) {
setValue("redemption", false)
setTimeout(function () {
trigger("bookingCode.value")
}, 5000)
}
}
const closeIfOutside = useCallback(