Skip to content
Snippets Groups Projects
Commit 74bbed5b authored by Ron Lucke's avatar Ron Lucke Committed by Till Glöggler
Browse files

Biest#283

parent edbcccde
No related branches found
No related tags found
No related merge requests found
...@@ -111,7 +111,10 @@ export default { ...@@ -111,7 +111,10 @@ export default {
let children = this.structuralElement.relationships.children.data; let children = this.structuralElement.relationships.children.data;
let childElements = []; let childElements = [];
children.forEach((element) => { children.forEach((element) => {
childElements.push(view.structuralElementById({ id: element.id })); let childElement = view.structuralElementById({ id: element.id });
if (childElement.attributes['can-read']) {
childElements.push(childElement);
}
}); });
return childElements; return childElements;
......
...@@ -56,20 +56,22 @@ export default { ...@@ -56,20 +56,22 @@ export default {
function buildNodes(structuralElements, relatedStructuralElement) { function buildNodes(structuralElements, relatedStructuralElement) {
return structuralElements.reduce((memo, element) => { return structuralElements.reduce((memo, element) => {
memo.push({ if (element.attributes['can-read']) {
id: element.id, memo.push({
parent: id: element.id,
relatedStructuralElement({ parent:
parent: element, relatedStructuralElement({
relationship: 'parent', parent: element,
})?.id ?? null, relationship: 'parent',
})?.id ?? null,
children: children:
relatedStructuralElement({ relatedStructuralElement({
parent: element, parent: element,
relationship: 'children', relationship: 'children',
})?.map((child) => child.id) ?? [], })?.map((child) => child.id) ?? [],
}); });
}
return memo; return memo;
}, []); }, []);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment