فهرست منبع

fix Revision.api

Yuki Takei 7 سال پیش
والد
کامیت
8cd8eaaa23
2فایلهای تغییر یافته به همراه2 افزوده شده و 7 حذف شده
  1. 0 5
      src/server/routes/page.js
  2. 2 2
      src/server/routes/revision.js

+ 0 - 5
src/server/routes/page.js

@@ -127,10 +127,6 @@ module.exports = function(crowi, app) {
     }
   }
 
-  async function addRenderVarsForHistory(renderVars, page) {
-    renderVars.tree = await Revision.findRevisionList(page.path, {});
-  }
-
   async function addRenderVarsForSlack(renderVars, page) {
     renderVars.slack = await getSlackChannels(page);
   }
@@ -384,7 +380,6 @@ module.exports = function(crowi, app) {
     addRendarVarsForPage(renderVars, page);
 
     await addRenderVarsForSlack(renderVars, page);
-    await addRenderVarsForHistory(renderVars, page);
     await addRenderVarsForDescendants(renderVars, page, req.user, offset, limit);
 
     if (isUserPage(page.path)) {

+ 2 - 2
src/server/routes/revision.js

@@ -44,7 +44,7 @@ module.exports = function(crowi, app) {
     const pageId = req.query.page_id || null;
 
     if (pageId && crowi.isPageId(pageId)) {
-      Page.findPageByIdAndGrantedUser(pageId, req.user)
+      Page.findOneByIdAndViewer(pageId, req.user)
       .then(function(pageData) {
         debug('Page found', pageData._id, pageData.path);
         return Revision.findRevisionIdList(pageData.path);
@@ -72,7 +72,7 @@ module.exports = function(crowi, app) {
     const pageId = req.query.page_id || null;
 
     if (pageId) {
-      Page.findPageByIdAndGrantedUser(pageId, req.user)
+      Page.findOneByIdAndViewer(pageId, req.user)
       .then(function(pageData) {
         debug('Page found', pageData._id, pageData.path);
         return Revision.findRevisionList(pageData.path, {});