devguard
devguard copied to clipboard
Subprojects are returned from the API without being able to distingush those from assets
Description:
Projects can have subprojects (identified by the parent_id column). The current contenttree function returns a flat list of subprojects and assets mixed together, with no way to distinguish between them.
org_repository.go@ContentTree
Problem:
- Subprojects and assets are returned at the same level.
- No clear structure or type indication for items.
- Difficult to handle or visualize nested project hierarchies.
Proposed Solution:
Refactor the contenttree function to return a proper hierarchical tree structure as JSON, e.g.:
[{
"id": 1,
"name": "Main Project",
"type": "project",
"children": [
{
"id": 2,
"name": "Subproject A",
"type": "subproject",
"children": [ ... ]
},
{
"id": 10,
"name": "Asset X",
"type": "asset"
}
]
}]
We need to make corresponding changes to the frontend as well.
this is not needed anymore