diff --git a/src/components/Dashboard/common/ObjectSelect.jsx b/src/components/Dashboard/common/ObjectSelect.jsx index 67b81b8..6c44734 100644 --- a/src/components/Dashboard/common/ObjectSelect.jsx +++ b/src/components/Dashboard/common/ObjectSelect.jsx @@ -98,10 +98,11 @@ const ObjectSelect = ({ const newFilterPath = filterPath.concat({ property, value: key }) return { title: , - value: key, - key: parentKeys.concat(key).join(':'), + value: parentKeys.concat(key).join('-'), + filterValue: key, + key: parentKeys.concat(key).join('-'), property, - parentKeys: parentKeys.concat(key || ':'), + parentKeys: parentKeys.concat(key || '-'), filterPath: newFilterPath, selectable: false, children: buildTreeData( @@ -131,7 +132,7 @@ const ObjectSelect = ({ customFilter[property] = value }) } - customFilter[node.property] = node.value + customFilter[node.property] = node.filterValue // Fetch children for this node const data = await handleFetchObjectsProperties(customFilter) if (!data) return @@ -141,14 +142,14 @@ const ObjectSelect = ({ // If the API returns an object with multiple keys, get only the data for this node nodeSpecificData = data[node.value] || {} } - // Build new children only for this specific node - const children = buildTreeData( + // Build new tree children only for this specific node + const treeChildren = buildTreeData( nodeSpecificData, properties.indexOf(node.property) + 1, node.parentKeys || [], (node.filterPath || []).concat({ property: node.property, - value: node.value + value: node.filterValue }) ) // Update treeData with new children for this node only