itizawa 5 лет назад
Родитель
Сommit
86d1e75a24
1 измененных файлов с 5 добавлено и 5 удалено
  1. 5 5
      src/server/models/page.js

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

@@ -150,12 +150,12 @@ class PageQueryBuilder {
   /**
   /**
    * generate the query to find the page that is match with `path` and its descendants
    * generate the query to find the page that is match with `path` and its descendants
    */
    */
-  addConditionToListWithDescendants(path) {
+  addConditionToListWithDescendants(path, option) {
     // ignore other pages than descendants
     // ignore other pages than descendants
     // eslint-disable-next-line no-param-reassign
     // eslint-disable-next-line no-param-reassign
     path = addSlashOfEnd(path);
     path = addSlashOfEnd(path);
 
 
-    this.addConditionToListByStartWith(path);
+    this.addConditionToListByStartWith(path, option);
     return this;
     return this;
   }
   }
 
 
@@ -166,7 +166,7 @@ class PageQueryBuilder {
    * If top page, return without doing anything.
    * If top page, return without doing anything.
    *
    *
    */
    */
-  addConditionToListByStartWith(path) {
+  addConditionToListByStartWith(path, option) {
     // No request is set for the top page
     // No request is set for the top page
     if (isTopPage(path)) {
     if (isTopPage(path)) {
       return this;
       return this;
@@ -690,7 +690,7 @@ module.exports = function(crowi) {
    */
    */
   pageSchema.statics.findListWithDescendants = async function(path, user, option) {
   pageSchema.statics.findListWithDescendants = async function(path, user, option) {
     const builder = new PageQueryBuilder(this.find());
     const builder = new PageQueryBuilder(this.find());
-    builder.addConditionToListWithDescendants(path);
+    builder.addConditionToListWithDescendants(path, option);
 
 
     return await findListFromBuilderAndViewer(builder, user, false, option);
     return await findListFromBuilderAndViewer(builder, user, false, option);
   };
   };
@@ -700,7 +700,7 @@ module.exports = function(crowi) {
    */
    */
   pageSchema.statics.findListByStartWith = async function(path, user, option) {
   pageSchema.statics.findListByStartWith = async function(path, user, option) {
     const builder = new PageQueryBuilder(this.find());
     const builder = new PageQueryBuilder(this.find());
-    builder.addConditionToListByStartWith(path);
+    builder.addConditionToListByStartWith(path, option);
 
 
     return await findListFromBuilderAndViewer(builder, user, false, option);
     return await findListFromBuilderAndViewer(builder, user, false, option);
   };
   };