fix: sanitize experiment form data to prevent save failure on empty dates

This commit is contained in:
Christian Vidal Wolf
2026-02-21 11:25:39 +01:00
parent b1346183c9
commit b2598f4c49
+10 -1
View File
@@ -66,7 +66,16 @@ const ExperimentForm: React.FC<ExperimentFormProps> = ({
setLoading(true); setLoading(true);
try { try {
await createExperiment(formData); // Sanitize optional fields
const submissionData = {
...formData,
end_date: formData.end_date || undefined,
description: formData.description || undefined,
hypothesis: formData.hypothesis || undefined,
owner: formData.owner || undefined,
};
await createExperiment(submissionData);
onSuccess(); onSuccess();
onClose(); onClose();
} catch (error: any) { } catch (error: any) {