Taichi Masuyama пре 4 година
родитељ
комит
7eb0c375d1
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      packages/app/src/server/service/page.ts

+ 2 - 1
packages/app/src/server/service/page.ts

@@ -1381,6 +1381,7 @@ class PageService {
 
     const revertDeletedDescendants = this.revertDeletedDescendants.bind(this);
     const normalizeParentRecursively = this.normalizeParentRecursively.bind(this);
+    const shouldNormalizeParent = this.shouldNormalizeParent.bind(this);
     let count = 0;
     const writeStream = new Writable({
       objectMode: true,
@@ -1399,7 +1400,7 @@ class PageService {
       async final(callback) {
         const Page = mongoose.model('Page') as unknown as PageModel;
         // normalize parent of descendant pages
-        const shouldNormalize = targetPage.grant !== Page.GRANT_RESTRICTED && targetPage.grant !== Page.GRANT_SPECIFIED;
+        const shouldNormalize = shouldNormalizeParent(targetPage);
         if (shouldNormalize) {
           try {
             const newPath = Page.getRevertDeletedPageName(targetPage.path);