Explorar o código

add syncDescendants

itizawa %!s(int64=5) %!d(string=hai) anos
pai
achega
553466078a
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      src/server/service/page.js

+ 4 - 1
src/server/service/page.js

@@ -313,6 +313,7 @@ class PageService {
     });
     });
 
 
     const duplicateDescendants = this.duplicateDescendants.bind(this);
     const duplicateDescendants = this.duplicateDescendants.bind(this);
+    const pageEvent = this.pageEvent;
     let count = 0;
     let count = 0;
     const writeStream = new Writable({
     const writeStream = new Writable({
       objectMode: true,
       objectMode: true,
@@ -330,7 +331,9 @@ class PageService {
       },
       },
       final(callback) {
       final(callback) {
         logger.debug(`Adding pages has completed: (totalCount=${count})`);
         logger.debug(`Adding pages has completed: (totalCount=${count})`);
-
+        // update  path
+        page.path = newPagePath;
+        pageEvent.emit('syncDescendants', page, user);
         callback();
         callback();
       },
       },
     });
     });