diff --git a/components/Forms/Register/schema.ts b/components/Forms/Register/schema.ts index 982641d2c..2584a02fe 100644 --- a/components/Forms/Register/schema.ts +++ b/components/Forms/Register/schema.ts @@ -3,6 +3,7 @@ import { z } from "zod" import { passwordValidator } from "@/utils/passwordValidator" import { phoneValidator } from "@/utils/phoneValidator" +const countryRequiredMsg = "Country is required" export const registerSchema = z.object({ firstName: z .string() @@ -23,7 +24,12 @@ export const registerSchema = z.object({ ), dateOfBirth: z.string().min(1), address: z.object({ - countryCode: z.string(), + countryCode: z + .string({ + required_error: countryRequiredMsg, + invalid_type_error: countryRequiredMsg, + }) + .min(1, countryRequiredMsg), zipCode: z.string().min(1), }), password: passwordValidator("Password is required"),