takeru0001 5 лет назад
Родитель
Сommit
db449ec4b7
1 измененных файлов с 4 добавлено и 3 удалено
  1. 4 3
      src/server/routes/apiv3/pages.js

+ 4 - 3
src/server/routes/apiv3/pages.js

@@ -537,14 +537,15 @@ module.exports = (crowi) => {
     let result;
 
     if (isDuplicateRecursively) {
-      result = await Page.duplicateRecursively(page, newPagePath, req.user);
+      result = await crowi.pageService.duplicateRecursively(page, newPagePath, req.user);
     }
     else {
-      result = await Page.duplicate(page, newPagePath, req.user);
+      result = await crowi.pageService.duplicate(page, newPagePath, req.user);
     }
 
+    page.path = newPagePath;
     try {
-      await globalNotificationService.fire(GlobalNotificationSetting.EVENT.PAGE_CREATE, result.page, req.user);
+      await globalNotificationService.fire(GlobalNotificationSetting.EVENT.PAGE_CREATE, page, req.user);
     }
     catch (err) {
       logger.error('Create grobal notification failed', err);