|
@@ -1065,14 +1065,14 @@ class PageService {
|
|
|
// replace with an empty page
|
|
// replace with an empty page
|
|
|
const shouldReplace = await Page.exists({ parent: page._id });
|
|
const shouldReplace = await Page.exists({ parent: page._id });
|
|
|
if (shouldReplace) {
|
|
if (shouldReplace) {
|
|
|
- await Page.replaceTargetWithPage(page);
|
|
|
|
|
|
|
+ await Page.replaceTargetWithPage(page, null, true);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// update descendantCount of ancestors'
|
|
// update descendantCount of ancestors'
|
|
|
await this.updateDescendantCountOfAncestors(page.parent, -1, true);
|
|
await this.updateDescendantCountOfAncestors(page.parent, -1, true);
|
|
|
|
|
|
|
|
// delete leaf empty pages
|
|
// delete leaf empty pages
|
|
|
- await this.removeLeafEmptyPages(page, null, true);
|
|
|
|
|
|
|
+ await this.removeLeafEmptyPages(page);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
let deletedPage;
|
|
let deletedPage;
|