cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

Putting "Additional Input Required" doesn't bar you from creating a booking

Open sydwardrae opened this issue 2 years ago • 3 comments

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

  1. (for example) Went to event types
  2. Clicked on an event
  3. Set an addtl input to be 'required'
  4. Went and tried to book the link on incognito mode without entering the required information
  5. 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?

sydwardrae avatar May 02 '22 20:05 sydwardrae

i'm working on this issue and i think i've already found a solution for it

MatheusBeniniF avatar May 06 '22 13:05 MatheusBeniniF

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?

juliopiubello avatar Aug 08 '22 14:08 juliopiubello

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.

zomars avatar Aug 08 '22 19:08 zomars

Not sure when this got fixed, but it seems to work for now. @zomars can we close that issue? chrome-capture-2022-9-3 (1)

CarinaWolli avatar Oct 03 '22 12:10 CarinaWolli

@CarinaWolli it works at browser level (Chrome) But it hasn't been implemented in react hook forms (frontend) nor tRPC (backend) AFAIK

zomars avatar Oct 04 '22 19:10 zomars