Fix null/undefined type mismatches

This commit is contained in:
gpt-engineer-app[bot]
2025-11-03 01:35:07 +00:00
parent 2ce837f376
commit c4b1339f0d
4 changed files with 39 additions and 35 deletions

View File

@@ -170,7 +170,11 @@ export function ManufacturerForm({ onSubmit, onCancel, initialData }: Manufactur
})()}
precision={(watch('founded_date_precision') as DatePrecision) || 'year'}
onChange={(date, precision) => {
setValue('founded_date', date ? toDateOnly(date) : undefined);
if (date && typeof date === 'string') {
setValue('founded_date', toDateOnly(date) as any);
} else {
setValue('founded_date', null as any);
}
setValue('founded_date_precision', precision);
}}
label="Founded Date"