Skip to content

Commit 0124cd5

Browse files
committed
fixup! front: editor-slopes-fix-form-validation
1 parent 0a4b979 commit 0124cd5

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

front/src/applications/editor/components/EditorForm.tsx

+17
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,23 @@ function EditorForm<T extends Omit<EditorEntity, 'objType'> & { objType: string
8484
}
8585
}, [error]);
8686

87+
useEffect(() => {
88+
if (!data.properties["slopes"]) {
89+
data.properties["slopes"] = [{
90+
begin: 0,
91+
end: data.properties["length"],
92+
gradient: 0
93+
}]
94+
}
95+
if (!data.properties["curves"]) {
96+
data.properties["curves"] = [{
97+
begin: 0,
98+
end: data.properties["length"],
99+
radius: 0
100+
}]
101+
}
102+
setFormData(data.properties)
103+
}, [data.properties["length"]])
87104
return (
88105
<div>
89106
{submited && error !== null && (

0 commit comments

Comments
 (0)