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

Co-authored-by: gitstart-calcom <gitstart@users.noreply.github.com>
This commit is contained in:
GitStart-Cal.com
2023-09-18 21:15:40 +02:00
committed by GitHub
co-authored by gitstart-calcom
parent 837bf5d604
commit 8d9d7bbb25
@@ -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,