Просмотр исходного кода

replace renameSubOperation with fixPathsAndDescendantCount

yohei0125 3 лет назад
Родитель
Сommit
1d5f4bd44c
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      packages/app/src/server/service/page.ts

+ 5 - 1
packages/app/src/server/service/page.ts

@@ -634,7 +634,11 @@ class PageService {
       page, fromPath, toPath, options, user,
     } = pageOp;
 
-    await this.renameSubOperation(page, toPath, user, options, renamedPage, pageOp._id);
+    this.fixPathsAndDescendantCount(page, user, options, renamedPage, pageOp._id, fromPath, toPath);
+  }
+
+  async fixPathsAndDescendantCount(page, user, options, renamedPage, pageOpId, fromPath, toPath): Promise<void> {
+    await this.renameSubOperation(page, toPath, user, options, renamedPage, pageOpId);
     const ancestorsPaths = this.crowi.pageOperationService.getAncestorsPathsByFromAndToPath(fromPath, toPath);
     await this.updateDescendantCountOfPagesWithPaths(ancestorsPaths);
   }