Taichi Masuyama 4 ani în urmă
părinte
comite
ddfceb95e6
1 a modificat fișierele cu 3 adăugiri și 3 ștergeri
  1. 3 3
      packages/app/src/server/service/page.ts

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

@@ -1783,10 +1783,10 @@ class PageService {
     /*
      * Sub Operation
      */
-    await this.revertRecursivelySubOperation(page, newPath, pageOp._id);
+    await this.revertRecursivelySubOperation(newPath, pageOp._id);
   }
 
-  async revertRecursivelySubOperation(page, newPath: string, pageOpId: ObjectIdLike): Promise<void> {
+  async revertRecursivelySubOperation(newPath: string, pageOpId: ObjectIdLike): Promise<void> {
     const Page = mongoose.model('Page') as unknown as PageModel;
 
     const newTarget = await Page.findOne({ path: newPath }); // only one page will be found since duplicating to existing path is forbidden
@@ -1796,7 +1796,7 @@ class PageService {
     }
 
     // update descendantCount of ancestors'
-    await this.updateDescendantCountOfAncestors(page.parent, newTarget.descendantCount + 1, true);
+    await this.updateDescendantCountOfAncestors(newTarget.parent as ObjectIdLike, newTarget.descendantCount + 1, true);
 
     await PageOperation.findByIdAndDelete(pageOpId);
   }