Taichi Masuyama 4 лет назад
Родитель
Сommit
64fda5c860
1 измененных файлов с 2 добавлено и 3 удалено
  1. 2 3
      packages/app/src/server/models/obsolete-page.js

+ 2 - 3
packages/app/src/server/models/obsolete-page.js

@@ -1011,9 +1011,6 @@ export const getPageSchema = (crowi) => {
         throw new Error('Cannot create new page to existed path');
         throw new Error('Cannot create new page to existed path');
       }
       }
 
 
-      const parentPath = nodePath.dirname(path);
-      const parent = await this.findOneParentByParentPath(parentPath);
-
       /*
       /*
        * UserGroup & Owner validation
        * UserGroup & Owner validation
        */
        */
@@ -1044,6 +1041,8 @@ export const getPageSchema = (crowi) => {
       }
       }
 
 
       let parentId = null;
       let parentId = null;
+      const parentPath = nodePath.dirname(path);
+      const parent = await this.findOneParentByParentPath(parentPath);
       if (!isTopPage(path)) {
       if (!isTopPage(path)) {
         parentId = await Page.getParentIdAndFillAncestors(path, parent);
         parentId = await Page.getParentIdAndFillAncestors(path, parent);
       }
       }