mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 06:11:12 -05:00
Fix TypeScript build errors
This commit is contained in:
@@ -101,7 +101,16 @@ export const companyValidationSchema = z.object({
|
||||
company_type: z.enum(['manufacturer', 'designer', 'operator', 'property_owner']),
|
||||
description: z.string().max(2000, 'Description must be less than 2000 characters').optional(),
|
||||
person_type: z.enum(['company', 'individual', 'firm', 'organization']),
|
||||
founded_year: z.number().min(1800, 'Founded year must be after 1800').max(currentYear, `Founded year cannot be in the future`).optional(),
|
||||
founded_year: z.string()
|
||||
.optional()
|
||||
.transform(val => {
|
||||
if (!val || val.trim() === '') return undefined;
|
||||
const num = Number(val);
|
||||
return isNaN(num) ? undefined : num;
|
||||
})
|
||||
.refine(val => val === undefined || (typeof val === 'number' && val >= 1800 && val <= currentYear), {
|
||||
message: `Founded year must be between 1800 and ${currentYear}`
|
||||
}),
|
||||
founded_date: z.string().optional(),
|
||||
founded_date_precision: z.enum(['day', 'month', 'year']).optional(),
|
||||
headquarters_location: z.string().max(200, 'Location must be less than 200 characters').optional(),
|
||||
|
||||
Reference in New Issue
Block a user