Просмотр исходного кода

fix normalize delete addHeadingSlash

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

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

@@ -412,7 +412,7 @@ module.exports = (crowi) => {
   router.post('/duplicate', accessTokenParser, loginRequiredStrictly, csrf, async(req, res) => {
     const { pageId } = req.body;
 
-    let newPagePath = pathUtils.normalizePath(req.body.pageNameInput);
+    const newPagePath = pathUtils.normalizePath(req.body.pageNameInput);
 
     // check page existence
     const isExist = (await Page.count({ path: newPagePath })) > 0;
@@ -430,9 +430,9 @@ module.exports = (crowi) => {
     }
 
     // check whether path starts slash
-    newPagePath = pathUtils.addHeadingSlash(newPagePath);
+    // newPagePath = pathUtils.addHeadingSlash(newPagePath);
 
-    // population
+    // populate
     await page.populate({ path: 'revision', model: 'Revision', select: 'body' }).execPopulate();
 
     // create option