Fixed error due to same values.

This commit is contained in:
Tom Butcher 2025-08-22 22:17:13 +01:00
parent 5d6fe05227
commit 9255f6bbe8

View File

@ -98,10 +98,11 @@ const ObjectSelect = ({
const newFilterPath = filterPath.concat({ property, value: key })
return {
title: <ObjectProperty type={property} value={key} />,
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