fix: Prevent duplicate documents in collection structure

This commit is contained in:
Tom Moor
2024-01-11 22:18:50 -05:00
parent 89931ca2f0
commit 2505fea103
2 changed files with 8 additions and 0 deletions

View File

@@ -647,6 +647,10 @@ class Collection extends ParanoidModel {
this.documentStructure = [];
}
if (this.getDocumentTree(document.id)) {
return this;
}
// If moving existing document with children, use existing structure
const documentJson = {
...(await document.toNavigationNode(options)),