fix: Unable to submit booking form if Attendee Phone is used and then booking Fields are saved (#15742)
* update for location identifier * for typecheck err * Update packages/features/bookings/lib/handleNewBooking/getBookingData.ts Co-authored-by: Amit Sharma <74371312+Amit91848@users.noreply.github.com> * update to use custom label for location, remove usage of hideWhenOneOption, remove string conversion of booking field * nit * nit * nit * Use the dataStore only instead of modifying bookingFields directly from outside the FormBuilder * Dont unset the actual label, instead have a different property noLabel for this --------- Co-authored-by: Amit Sharma <74371312+Amit91848@users.noreply.github.com> Co-authored-by: Hariom <hariombalhara@gmail.com>
This commit is contained in:
4 files changed
+108
-79
No files matched your search
@@ -268,23 +268,6 @@ const Locations: React.FC<LocationsProps> = ({
|
||||
});
|
||||
showToast(t("location_already_exists"), "warning");
|
||||
}
|
||||
// Whenever location changes, we need to reset the locations item in booking questions list else it overflows
|
||||
// previously added values resulting in wrong behaviour
|
||||
const existingBookingFields = getValues("bookingFields");
|
||||
const findLocation = existingBookingFields.findIndex(
|
||||
(field) => field.name === "location"
|
||||
);
|
||||
if (findLocation >= 0) {
|
||||
existingBookingFields[findLocation] = {
|
||||
...existingBookingFields[findLocation],
|
||||
type: "radioInput",
|
||||
label: "",
|
||||
placeholder: "",
|
||||
};
|
||||
setValue("bookingFields", existingBookingFields, {
|
||||
shouldDirty: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user