소스 검색

move method

yohei0125 4 년 전
부모
커밋
efe64bd43b
1개의 변경된 파일4개의 추가작업 그리고 8개의 파일을 삭제
  1. 4 8
      packages/app/src/server/service/page.ts

+ 4 - 8
packages/app/src/server/service/page.ts

@@ -687,13 +687,6 @@ class PageService {
       );
     }
 
-    if (isRecursively) {
-      (async() => {
-        const descendantCountAppliedToAncestors = await this.duplicateDescendantsWithStream(page, newPagePath, user, shouldUseV4Process);
-        await this.updateDescendantCountOfAncestors(createdPage._id, descendantCountAppliedToAncestors, false);
-      })();
-    }
-
     // take over tags
     const originTags = await page.findRelatedTagsById();
     let savedTags = [];
@@ -708,7 +701,10 @@ class PageService {
 
     // TODO: resume
     if (isRecursively) {
-      this.duplicateDescendantsWithStream(page, newPagePath, user, shouldUseV4Process);
+      (async() => {
+        const descendantCountAppliedToAncestors = await this.duplicateDescendantsWithStream(page, newPagePath, user, shouldUseV4Process);
+        await this.updateDescendantCountOfAncestors(createdPage._id, descendantCountAppliedToAncestors, false);
+      })();
     }
 
     return result;