Quellcode durchsuchen

Added a comment

Taichi Masuyama vor 4 Jahren
Ursprung
Commit
0b889d5643
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      packages/app/src/server/models/page.ts

+ 1 - 1
packages/app/src/server/models/page.ts

@@ -310,7 +310,7 @@ schema.statics.findChildrenByParentPathOrIdAndViewer = async function(parentPath
 };
 
 schema.statics.findAncestorsChildrenByPathAndViewer = async function(path: string, user, userGroups = null): Promise<Record<string, PageDocument[]>> {
-  const ancestorPaths = isTopPage(path) ? ['/'] : collectAncestorPaths(path);
+  const ancestorPaths = isTopPage(path) ? ['/'] : collectAncestorPaths(path); // root path is necessary for rendering
   const regexps = ancestorPaths.map(path => new RegExp(generateChildrenRegExp(path))); // cannot use re2
 
   // get pages at once