Browse Source

fix query

takeru0001 5 năm trước cách đây
mục cha
commit
252efcc26b
1 tập tin đã thay đổi với 3 bổ sung2 xóa
  1. 3 2
      src/server/service/search-delegator/elasticsearch.js

+ 3 - 2
src/server/service/search-delegator/elasticsearch.js

@@ -355,8 +355,9 @@ class ElasticsearchDelegator {
   updateOrInsertDescendantsPagesById(page, user) {
     const Page = mongoose.model('Page');
     const { PageQueryBuilder } = Page;
-    const findQuery = new PageQueryBuilder(Page.find()).addConditionToListWithDescendants(page.path).query;
-    return this.updateOrInsertPages(() => findQuery);
+    const builder = new PageQueryBuilder(Page.find());
+    builder.addConditionToListWithDescendants(page.path);
+    return this.updateOrInsertPages(() => builder.query);
   }
 
   /**