chore: remove Insurance default bias from Add Document modal (refs #175)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Eric Gullickson
2026-02-13 19:56:34 -06:00
parent afd4583450
commit daa0cd072e

View File

@@ -31,8 +31,8 @@ export const DocumentForm: React.FC<DocumentFormProps> = ({
onSuccess, onSuccess,
onCancel onCancel
}) => { }) => {
const [documentType, setDocumentType] = React.useState<DocumentType>( const [documentType, setDocumentType] = React.useState<DocumentType | ''>(
initialValues?.documentType || 'insurance' initialValues?.documentType || ''
); );
const [vehicleID, setVehicleID] = React.useState<string>(initialValues?.vehicleId || ''); const [vehicleID, setVehicleID] = React.useState<string>(initialValues?.vehicleId || '');
const [title, setTitle] = React.useState<string>(initialValues?.title || ''); const [title, setTitle] = React.useState<string>(initialValues?.title || '');
@@ -152,6 +152,10 @@ export const DocumentForm: React.FC<DocumentFormProps> = ({
setError('Please select a vehicle.'); setError('Please select a vehicle.');
return; return;
} }
if (!documentType) {
setError('Please select a document type.');
return;
}
if (!title.trim()) { if (!title.trim()) {
setError('Please enter a title.'); setError('Please enter a title.');
return; return;
@@ -337,7 +341,9 @@ export const DocumentForm: React.FC<DocumentFormProps> = ({
value={documentType} value={documentType}
onChange={(e) => setDocumentType(e.target.value as DocumentType)} onChange={(e) => setDocumentType(e.target.value as DocumentType)}
disabled={mode === 'edit'} disabled={mode === 'edit'}
required
> >
<option value="" disabled>Select a document type...</option>
<option value="insurance">Insurance</option> <option value="insurance">Insurance</option>
<option value="registration">Registration</option> <option value="registration">Registration</option>
<option value="manual">Manual</option> <option value="manual">Manual</option>