removed phone and emaill required validation

This commit is contained in:
Pramod Mahajan 2025-05-20 22:42:11 +05:30
parent 7942f37dd6
commit 7f8784bf6a

View File

@ -42,16 +42,16 @@ export const ContactSchema = z
bucketIds: z.array(z.string()).optional(),
})
.refine((data) => {
const hasValidEmail = (data.contactEmails || []).some(
(e) => e.emailAddress?.trim() !== ""
);
const hasValidPhone = (data.contactPhones || []).some(
(p) => p.phoneNumber?.trim() !== ""
);
// .refine((data) => {
// const hasValidEmail = (data.contactEmails || []).some(
// (e) => e.emailAddress?.trim() !== ""
// );
// const hasValidPhone = (data.contactPhones || []).some(
// (p) => p.phoneNumber?.trim() !== ""
// );
return hasValidEmail || hasValidPhone;
}, {
message: "At least one contact (email or phone) is required",
path: ["contactPhone"],
});
// return hasValidEmail || hasValidPhone;
// }, {
// message: "At least one contact (email or phone) is required",
// path: ["contactPhone"],
// });