feat: add validation message for title and employer input

This commit is contained in:
mehedi-hasan 2024-05-01 17:46:35 +06:00
parent 645f731a74
commit cd68d6f64c
2 changed files with 9 additions and 5 deletions

View File

@ -81,7 +81,7 @@ const Geolocation: FC<Props> = ({
const data = () => { const data = () => {
isCountry isCountry
? geonames.countryInfo({}).then((res: any) => { ? geonames.countryInfo({}).then((res: any) => {
console.log(res); // console.log(res);
setOptions(res.geonames); setOptions(res.geonames);
}) })
: geonames.children({ geonameId: geoId }).then((res: any) => { : geonames.children({ geonameId: geoId }).then((res: any) => {

View File

@ -36,10 +36,14 @@ export const profileSchema = z.object({
jobcountry: z.string().min(1, { message: "Please select a country" }), jobcountry: z.string().min(1, { message: "Please select a country" }),
jobstate: z.string().min(1, { message: "Please select a job state" }), jobstate: z.string().min(1, { message: "Please select a job state" }),
jobcity: z.string().min(1, { message: "Please select a city" }), jobcity: z.string().min(1, { message: "Please select a city" }),
jobtitle: z.string(), jobtitle: z
// .min(3, { message: "First Name must be at least 3 characters" }), .string()
employer: z.string(), .trim()
// .min(3, { message: "First Name must be at least 3 characters" }), .min(1, { message: "Please enter your job title" }),
employer: z
.string()
.trim()
.min(1, { message: "Please enter your employer name" }),
startdate: z startdate: z
.string() .string()
.refine((value) => /^\d{4}-\d{2}-\d{2}$/.test(value), { .refine((value) => /^\d{4}-\d{2}-\d{2}$/.test(value), {