#78 - include file boxes in page children for sidebar
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Garrett Mills 2021-02-04 15:15:39 -06:00
parent e32d38e9b6
commit 1758340a7b
Signed by: garrettmills
GPG Key ID: D2BF5FBA8298F246

View File

@ -280,6 +280,24 @@ class Page extends VersionedModel {
})
}
const FileBox = this.models.get('api:files:FileBox')
const boxes = await FileBox.find({
active: true,
pageId: this.UUID,
})
for ( const box of boxes ) {
if ( box.parentUUID ) continue; // only show top-level
children.push({
id: box.pageId,
// node_id // FIXME need to track this w/ the file boxes
children: [],
type: 'file_box',
name: box.name,
})
}
const Codium = this.models.get('api:Codium')
const codiums = await Codium.find({
PageId: this.UUID,