takeru0001 5 лет назад
Родитель
Сommit
52686112f8
1 измененных файлов с 4 добавлено и 5 удалено
  1. 4 5
      src/server/models/page.js

+ 4 - 5
src/server/models/page.js

@@ -1279,7 +1279,7 @@ module.exports = function(crowi) {
     pageEvent.emit('delete', pageData, user, socketClientId);
     pageEvent.emit('create', updatedPageData, user, socketClientId);
 
-    return updatedPageData;
+    return { updatedPageData };
   };
 
   pageSchema.statics.renameRecursively = async function(targetPage, newPagePathPrefix, user, options) {
@@ -1295,13 +1295,12 @@ module.exports = function(crowi) {
     const pages = await this.findManageableListWithDescendants(targetPage, user, options);
 
     // TODO GW-4634 use stream
-    await Promise.allSettled(pages.map((page) => {
+    const promise = pages.map((page) => {
       const newPagePath = page.path.replace(pathRegExp, newPagePathPrefix);
       return this.rename(page, newPagePath, user, options);
-    }));
+    });
 
-    targetPage.path = newPagePathPrefix;
-    return targetPage;
+    return Promise.allSettled(promise);
   };
 
   pageSchema.statics.findListByPathsArray = async function(paths) {