From cd68d6f64c59238b61cd37c30bc41a50839d16e4 Mon Sep 17 00:00:00 2001 From: mehedi-hasan Date: Wed, 1 May 2024 17:46:35 +0600 Subject: [PATCH] feat: add validation message for title and employer input --- src/components/geolocation.tsx | 2 +- src/lib/form-schema.ts | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/geolocation.tsx b/src/components/geolocation.tsx index 5b6c4cf..eec3eff 100644 --- a/src/components/geolocation.tsx +++ b/src/components/geolocation.tsx @@ -81,7 +81,7 @@ const Geolocation: FC = ({ const data = () => { isCountry ? geonames.countryInfo({}).then((res: any) => { - console.log(res); + // console.log(res); setOptions(res.geonames); }) : geonames.children({ geonameId: geoId }).then((res: any) => { diff --git a/src/lib/form-schema.ts b/src/lib/form-schema.ts index a96f0f9..941f27a 100644 --- a/src/lib/form-schema.ts +++ b/src/lib/form-schema.ts @@ -36,10 +36,14 @@ export const profileSchema = z.object({ jobcountry: z.string().min(1, { message: "Please select a country" }), jobstate: z.string().min(1, { message: "Please select a job state" }), jobcity: z.string().min(1, { message: "Please select a city" }), - jobtitle: z.string(), - // .min(3, { message: "First Name must be at least 3 characters" }), - employer: z.string(), - // .min(3, { message: "First Name must be at least 3 characters" }), + jobtitle: z + .string() + .trim() + .min(1, { message: "Please enter your job title" }), + employer: z + .string() + .trim() + .min(1, { message: "Please enter your employer name" }), startdate: z .string() .refine((value) => /^\d{4}-\d{2}-\d{2}$/.test(value), {