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

+ 0 - 29
src/server/routes/apiv3/pages.js

@@ -476,35 +476,6 @@ module.exports = (crowi) => {
       return res.apiv3Err(err, 500);
       return res.apiv3Err(err, 500);
     }
     }
   });
   });
-  async function duplicatePage(page, newPagePath, user) {
-    // populate
-    await page.populate({ path: 'revision', model: 'Revision', select: 'body' }).execPopulate();
-
-    // create option
-    const options = { page };
-    options.grant = page.grant;
-    options.grantUserGroupId = page.grantedGroup;
-    options.grantedUsers = page.grantedUsers;
-
-    const createdPage = await createPageAction({
-      path: newPagePath, user, body: page.revision.body, options,
-    });
-
-    const originTags = await page.findRelatedTagsById();
-    const savedTags = await saveTagsAction({ page, createdPage, pageTags: originTags });
-
-    // global notification
-    if (globalNotificationService != null) {
-      try {
-        await globalNotificationService.fire(GlobalNotificationSetting.EVENT.PAGE_CREATE, createdPage, user);
-      }
-      catch (err) {
-        logger.error('Create grobal notification failed', err);
-      }
-    }
-
-    return { page: pageService.serializeToObj(createdPage), tags: savedTags };
-  }
 
 
   async function duplicatePageRecursively(page, newPagePath, user) {
   async function duplicatePageRecursively(page, newPagePath, user) {
     const newPagePathPrefix = newPagePath;
     const newPagePathPrefix = newPagePath;