removed phone and emaill required validation
This commit is contained in:
parent
7942f37dd6
commit
7f8784bf6a
@ -42,16 +42,16 @@ export const ContactSchema = z
|
|||||||
bucketIds: z.array(z.string()).optional(),
|
bucketIds: z.array(z.string()).optional(),
|
||||||
})
|
})
|
||||||
|
|
||||||
.refine((data) => {
|
// .refine((data) => {
|
||||||
const hasValidEmail = (data.contactEmails || []).some(
|
// const hasValidEmail = (data.contactEmails || []).some(
|
||||||
(e) => e.emailAddress?.trim() !== ""
|
// (e) => e.emailAddress?.trim() !== ""
|
||||||
);
|
// );
|
||||||
const hasValidPhone = (data.contactPhones || []).some(
|
// const hasValidPhone = (data.contactPhones || []).some(
|
||||||
(p) => p.phoneNumber?.trim() !== ""
|
// (p) => p.phoneNumber?.trim() !== ""
|
||||||
);
|
// );
|
||||||
|
|
||||||
return hasValidEmail || hasValidPhone;
|
// return hasValidEmail || hasValidPhone;
|
||||||
}, {
|
// }, {
|
||||||
message: "At least one contact (email or phone) is required",
|
// message: "At least one contact (email or phone) is required",
|
||||||
path: ["contactPhone"],
|
// path: ["contactPhone"],
|
||||||
});
|
// });
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user