فهرست منبع

remove futile fn

yohei0125 3 سال پیش
والد
کامیت
e4178a08ab
1فایلهای تغییر یافته به همراه3 افزوده شده و 11 حذف شده
  1. 3 11
      packages/app/src/server/service/page.ts

+ 3 - 11
packages/app/src/server/service/page.ts

@@ -620,17 +620,9 @@ class PageService {
       page, fromPath, toPath, options, user,
     } = pageOp;
 
-    // this want be used only in this method
-    const renameAndRecountDescendantCount = async(
-        page, user, options, renamedPage: PageDocument, pageOpId, fromPath:string, toPath:string,
-    ): Promise<void> => {
-      await this.renameSubOperation(page, toPath, user, options, renamedPage, pageOpId);
-      // get ancestors
-      const ancestors = this.crowi.pageOperationService.getAncestorsPathsByFromAndToPath(fromPath, toPath);
-      await this.recountAndUpdateDescendantCount(ancestors);
-    };
-
-    renameAndRecountDescendantCount(page, user, options, renamedPage, pageOp._id, fromPath, toPath);
+    await this.renameSubOperation(page, toPath, user, options, renamedPage, pageOp._id);
+    const ancestors = this.crowi.pageOperationService.getAncestorsPathsByFromAndToPath(fromPath, toPath);
+    await this.recountAndUpdateDescendantCount(ancestors);
   }
 
   private isRenamingToUnderTarget(fromPath: string, toPath: string): boolean {