Bug Description
The country field in job search accepts numeric values instead of validating country names.
Affected Code
Job search form or validation
Issue
- Country field expected to be string
- Accepts numbers
- Passes to API that expects country codes
- Jobs search fails
Impact
- Invalid API calls
- Confusing errors
- Poor UX
Suggested Fix
Validate country input:
const validCountries = ['US', 'GB', 'CA', 'AU', 'DE', 'FR'];
const jobSearchSchema = z.object({
country: z.string()
.length(2)
.refine(val => validCountries.includes(val.toUpperCase()), {
message: 'Invalid country code'
})
});
Bug Description
The country field in job search accepts numeric values instead of validating country names.
Affected Code
Job search form or validation
Issue
Impact
Suggested Fix
Validate country input: