mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-08-26 01:16:16 +00:00
And this frontend one
This commit is contained in:
@@ -142,12 +142,12 @@ export class TagsComponent implements OnInit, ControlValueAccessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private removeChildren(tagIDs: number[], tag: Tag) {
|
private removeChildren(tagIDs: number[], tag: Tag) {
|
||||||
if (tag.children.length > 0) {
|
if (tag.children?.length) {
|
||||||
const childIDs = tag.children.map((child) => child.id)
|
const childIDs = tag.children.map((child) => child.id)
|
||||||
tagIDs = tagIDs.filter((id) => !childIDs.includes(id))
|
tagIDs = tagIDs.filter((id) => !childIDs.includes(id))
|
||||||
}
|
for (const child of tag.children) {
|
||||||
for (const child of tag.children) {
|
tagIDs = this.removeChildren(tagIDs, child)
|
||||||
tagIDs = this.removeChildren(tagIDs, child)
|
}
|
||||||
}
|
}
|
||||||
return tagIDs
|
return tagIDs
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user