Skip to content

Commit 981b632

Browse files
committed
Ensuring slug isn't submitted or updated when editing node data.
1 parent 5c5565b commit 981b632

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/designer/edit_modal.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ function EditNode({ show, setShow, setNodes, activeFlow, node }: { show: boolean
5252
// Loop over the form fields and add them to the node data field
5353
const formData: { [key: string]: string } = {};
5454
for (let i = 1; i < e.target.length-2; i++) {
55+
if (e.target[i].name === "" || e.target[i].name === "slug") { continue; }
5556
const fieldName = e.target[i].name;
5657
const fieldValue = e.target[i].value;
5758
formData[fieldName] = fieldValue;
@@ -81,7 +82,7 @@ function EditNode({ show, setShow, setNodes, activeFlow, node }: { show: boolean
8182
<Form.Group className="mb-3" controlId="NewModal.NodeType">
8283
</Form.Group>
8384
{node && Object.keys(node.data).map((key: any) => {
84-
if (key === "") { return null; }
85+
if (key === "" || key === "slug") { return null; }
8586
else { return (RenderNodeTypeForm(key, node.data[key])); }
8687
})}
8788
</Modal.Body>

0 commit comments

Comments
 (0)