cal.com
cal.com copied to clipboard
Putting "Additional Input Required" doesn't bar you from creating a booking
Found a bug? Please fill out the sections below. 👍
Issue Summary
when you click 'is required' for a new custom input field, you can still make a booking without filling in the custom input field
Steps to Reproduce
- (for example) Went to event types
- Clicked on an event
- Set an addtl input to be 'required'
- Went and tried to book the link on incognito mode without entering the required information
- Was still able to book with the 'required' info not put in
Any other relevant information. For example, why do you consider this a bug and what did you expect to happen instead?
i'm working on this issue and i think i've already found a solution for it
Hi @CarinaWolli and @zomars
We would love to push a PR for this issue but we want to clarify a couple of items before:
In order to validate the custom fields marked as required by the user, we need to make a database request and check which ones are the required and give back an error if it is missing any (I don't think the zod schema can do this) And also do the frontend validation
like we did on this PR: https://github.com/calcom/cal.com/pull/3062/files
Is there anything we can do to help you close this issue?
Thanks for the input @juliopiubello the way I see it we can tackle frontend and backend with two different schemas. One for the frontend that just makes sure required fields are present. The backend one will be run on tRPC which has prisma in the context, there we can expand validation to the DB as mentioned and throw a 400 error if invalid.
Not sure when this got fixed, but it seems to work for now. @zomars can we close that issue?
@CarinaWolli it works at browser level (Chrome) But it hasn't been implemented in react hook forms (frontend) nor tRPC (backend) AFAIK