Yuki Takei 3 years ago
parent
commit
79820aa873
1 changed files with 3 additions and 6 deletions
  1. 3 6
      packages/app/src/server/models/page.ts

+ 3 - 6
packages/app/src/server/models/page.ts

@@ -223,13 +223,10 @@ export class PageQueryBuilder {
     const ancestorsPaths = extractToAncestorsPaths(pathNormalized);
     const ancestorsPaths = extractToAncestorsPaths(pathNormalized);
 
 
     this.query = this.query
     this.query = this.query
+      // exclude the target page
+      .and({ path: { $ne: path } })
       .and(
       .and(
-        { path: { $ne: path } }, // exclude the target page
-        {
-          path: {
-            $in: ancestorsPaths,
-          },
-        },
+        { path: { $in: ancestorsPaths } },
       );
       );
 
 
     return this;
     return this;