瀏覽代碼

refactor deletePageRecursively

itizawa 5 年之前
父節點
當前提交
6af66ba427
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      src/server/models/page.js

+ 3 - 3
src/server/models/page.js

@@ -1111,11 +1111,11 @@ module.exports = function(crowi) {
       throw new Error('This method does NOT supports deleting trashed pages.');
       throw new Error('This method does NOT supports deleting trashed pages.');
     }
     }
 
 
-    // find descendants (this array does not include GRANT_RESTRICTED)
-    const result = await this.findListWithDescendants(targetPage.path, user);
+    // find manageable descendants (this array does not include GRANT_RESTRICTED)
+    const result = await this.findManageableListWithDescendants(targetPage.path, user, options);
     const pages = result.pages;
     const pages = result.pages;
     // add targetPage if 'grant' is GRANT_RESTRICTED
     // add targetPage if 'grant' is GRANT_RESTRICTED
-    //  because findListWithDescendants excludes GRANT_RESTRICTED pages
+    //  because findManageableListWithDescendants excludes GRANT_RESTRICTED pages
     if (targetPage.grant === GRANT_RESTRICTED) {
     if (targetPage.grant === GRANT_RESTRICTED) {
       pages.push(targetPage);
       pages.push(targetPage);
     }
     }