Fix error propagation in forms

This commit is contained in:
gpt-engineer-app[bot]
2025-11-03 16:51:49 +00:00
parent 700c29c910
commit 12de4e2ec1
8 changed files with 71 additions and 16 deletions

View File

@@ -94,6 +94,9 @@ export function DesignerForm({ onSubmit, onCancel, initialData }: DesignerFormPr
action: initialData?.id ? 'Update Designer' : 'Create Designer',
metadata: { companyName: data.name }
});
// Re-throw so parent can handle modal closing
throw error;
}
})} className="space-y-6">
{/* Basic Information */}

View File

@@ -98,6 +98,9 @@ export function ManufacturerForm({ onSubmit, onCancel, initialData }: Manufactur
action: initialData?.id ? 'Update Manufacturer' : 'Create Manufacturer',
metadata: { companyName: data.name }
});
// Re-throw so parent can handle modal closing
throw error;
}
})} className="space-y-6">
{/* Basic Information */}

View File

@@ -94,6 +94,9 @@ export function OperatorForm({ onSubmit, onCancel, initialData }: OperatorFormPr
action: initialData?.id ? 'Update Operator' : 'Create Operator',
metadata: { companyName: data.name }
});
// Re-throw so parent can handle modal closing
throw error;
}
})} className="space-y-6">
{/* Basic Information */}

View File

@@ -274,6 +274,9 @@ export function ParkForm({ onSubmit, onCancel, initialData, isEditing = false }:
hasNewOwner: !!tempNewPropertyOwner
}
});
// Re-throw so parent can handle modal closing
throw error;
}
};

View File

@@ -94,6 +94,9 @@ export function PropertyOwnerForm({ onSubmit, onCancel, initialData }: PropertyO
action: initialData?.id ? 'Update Property Owner' : 'Create Property Owner',
metadata: { companyName: data.name }
});
// Re-throw so parent can handle modal closing
throw error;
}
})} className="space-y-6">
{/* Basic Information */}

View File

@@ -352,6 +352,9 @@ export function RideForm({ onSubmit, onCancel, initialData, isEditing = false }:
hasNewModel: !!tempNewRideModel
}
});
// Re-throw so parent can handle modal closing
throw error;
}
};

View File

@@ -113,6 +113,9 @@ export function RideModelForm({
handleError(error, {
action: initialData?.id ? 'Update Ride Model' : 'Create Ride Model'
});
// Re-throw so parent can handle modal closing
throw error;
}
};