fix: Required "Add guests" button isn't required on attendee's end (#11381)

Co-authored-by: gitstart-calcom <gitstart@users.noreply.github.com>
pull/11416/head^2
GitStart-Cal.com 2023-09-18 19:15:40 +00:00 committed by GitHub
parent 837bf5d604
commit 8d9d7bbb25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -166,6 +166,12 @@ function preprocess<T extends z.ZodType>({
if (bookingField.type === "multiemail") {
const emailsParsed = emailSchema.array().safeParse(value);
if (isRequired && (!value || value.length === 0)) {
ctx.addIssue({ code: z.ZodIssueCode.custom, message: m(`error_required_field`) });
continue;
}
if (!emailsParsed.success) {
ctx.addIssue({
code: z.ZodIssueCode.custom,