Kaynağa Gözat

modified generatePathsOnTree

sou 8 yıl önce
ebeveyn
işleme
13dce3c8fe
1 değiştirilmiş dosya ile 4 ekleme ve 4 silme
  1. 4 4
      lib/models/page.js

+ 4 - 4
lib/models/page.js

@@ -548,13 +548,13 @@ module.exports = function(crowi) {
   };
 
   const generatePathsOnTree = (path, pathList) => {
-    const newPath = cutOffLastSlash(path);
-
-    if (newPath === '') {
+    if (path === '') {
       return pathList;
     }
 
-    pathList.push(newPath);
+    pathList.push(path);
+    const newPath = cutOffLastSlash(path);
+
     return generatePathsOnTree(newPath, pathList);
   };