fix: update phone number validation to allow shorter lengths

This commit is contained in:
Abhinav Raut
2025-04-15 03:45:54 +05:30
parent 450b609d47
commit 061677f2b0
+2 -2
View File
@@ -22,9 +22,9 @@ export const createFormSchema = (t) => z.object({
phone_number: z
.string()
.optional()
.refine(val => !val || (/^\d{6,15}$/.test(val)), {
.refine(val => !val || (/^\d{1,15}$/.test(val)), {
message: t('form.error.minmax', {
min: 6,
min: 1,
max: 15,
})
})