Fix bug to check opt in bookings (#2889)

* Fix bug to check opt in bookings

* Implemented value, onChange instead of form access

Co-authored-by: Alex van Andel <me@alexvanandel.com>
This commit is contained in:
Joe Au-Yeung
2022-05-26 16:24:19 +01:00
committed by GitHub
co-authored by Alex van Andel
parent 727c6f723e
commit c67338bb3f
2 changed files with 4 additions and 7 deletions
+3 -6
View File
@@ -1439,9 +1439,8 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
<Controller
name="requiresConfirmation"
control={formMethods.control}
defaultValue={eventType.requiresConfirmation}
render={() => (
render={({ field: { value, onChange } }) => (
<CheckboxField
id="requiresConfirmation"
descriptionAsLabel
@@ -1450,10 +1449,8 @@ const EventTypePage = (props: inferSSRProps<typeof getServerSideProps>) => {
description={t("opt_in_booking_description")}
defaultChecked={eventType.requiresConfirmation}
disabled={enableSeats}
checked={formMethods.watch("disableGuests")}
onChange={(e) => {
formMethods.setValue("requiresConfirmation", e?.target.checked);
}}
checked={value}
onChange={(e) => onChange(e?.target.checked)}
/>
)}
/>
@@ -768,7 +768,7 @@
"redirect_url_upgrade_description": "In order to use this feature, you need to upgrade to a Pro account.",
"duplicate": "Duplicate",
"offer_seats": "Offer seats",
"offer_seats_description": "Offer seats to bookings (This disables guests)",
"offer_seats_description": "Offer seats to bookings (This disables guests & opt in bookings)",
"seats_available": "Seats available",
"number_of_seats": "Number of seats per booking",
"enter_number_of_seats": "Enter number of seats",