sou 7 лет назад
Родитель
Сommit
8585f6a8e0
3 измененных файлов с 2 добавлено и 8 удалено
  1. 0 1
      lib/models/page.js
  2. 1 6
      lib/routes/page.js
  3. 1 1
      lib/views/modal/create_page.html

+ 0 - 1
lib/models/page.js

@@ -548,7 +548,6 @@ module.exports = function(crowi) {
       childrenTemplateExists: false,
       decendantsTemplateExists: false,
     };
-    console.log('regexp', regexpList)
 
     return Page
       .find({path: {$in: regexpList}})

+ 1 - 6
lib/routes/page.js

@@ -1180,12 +1180,7 @@ module.exports = function(crowi, app) {
    * @apiParam {String} path
    */
   api.templates = function(req, res) {
-    const pagePath = req.query.path || null;
-
-    if (!pagePath) {
-      return res.json(ApiResponse.error(new Error('Parameter path is required.')));
-    }
-
+    const pagePath = req.query.path;
     const templateFinder = Page.checkIfTemplatesExist(pagePath);
 
     templateFinder.then(function(templateInfo) {

+ 1 - 1
lib/views/modal/create_page.html

@@ -78,7 +78,7 @@
   let pagePath = $("#link-to-template").attr("href");
 
   if (pagePath.endsWith("/")) {
-    pagePath = pagePath.slice(0, -1);
+      pagePath = pagePath.slice(0, -1);
   };
 
   $.get(`/_api/pages.templates?path=${pagePath}`)