Skip to content

Commit

Permalink
Also use the name items instead of children
Browse files Browse the repository at this point in the history
  • Loading branch information
ale-rt committed Jan 23, 2025
1 parent f249548 commit 476258d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/osha/oira/services/navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def fix_node(self, node):
mapping = {
"portal_type": "@type",
"url": "@id",
"children": "items",
}
for old_key, new_key in mapping.items():
if old_key in node:
Expand All @@ -47,8 +48,8 @@ def fix_node(self, node):
node["@type"] = node["@type"].replace("-", ".")

# Recurse into children
if "children" in node:
for child in node["children"]:
if "items" in node:
for child in node["items"]:
self.fix_node(child)

return node
Expand Down

0 comments on commit 476258d

Please sign in to comment.