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

remove Descendants and Slack infomation

itizawa 5 лет назад
Родитель
Сommit
ca5ad07ac2
2 измененных файлов с 3 добавлено и 8 удалено
  1. 1 1
      src/server/routes/index.js
  2. 2 7
      src/server/routes/page.js

+ 1 - 1
src/server/routes/index.js

@@ -180,7 +180,7 @@ module.exports = function(crowi, app) {
   app.post('/_api/hackmd.discard'        , accessTokenParser , loginRequiredStrictly , csrf, hackmd.validateForApi, hackmd.discard);
   app.post('/_api/hackmd.saveOnHackmd'   , accessTokenParser , loginRequiredStrictly , csrf, hackmd.validateForApi, hackmd.saveOnHackmd);
 
-  app.get('/share/:path', page.showSharePage);
+  app.get('/share/:link', page.showSharePage);
 
   app.get('/*/$'                   , loginRequired , page.showPageWithEndOfSlash, page.notFound);
   app.get('/*'                     , loginRequired , page.showPage, page.notFound);

+ 2 - 7
src/server/routes/page.js

@@ -440,24 +440,19 @@ module.exports = function(crowi, app) {
   };
 
   actions.showSharePage = async function(req, res, next) {
-    const { path } = req.params;
+    // const { link } = req.params;
 
     const layoutName = configManager.getConfig('crowi', 'customize:layout');
     let view = `layout-${layoutName}/page`;
 
-    // TODO
+    // TODO find page by link
     const page = {};
 
-    const limit = 50;
-    const offset = parseInt(req.query.offset) || 0;
     const renderVars = {};
 
     addRendarVarsForPage(renderVars, page);
     addRendarVarsForScope(renderVars, page);
 
-    await addRenderVarsForSlack(renderVars, page);
-    await addRenderVarsForDescendants(renderVars, path, req.user, offset, limit, true);
-
     if (isUserPage(page.path)) {
       // change template
       view = `layout-${layoutName}/user_page`;