Browse Source

change how to check page exist

yusuketk 5 years ago
parent
commit
05f7949a41
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/server/routes/apiv3/page.js

+ 1 - 1
src/server/routes/apiv3/page.js

@@ -207,7 +207,7 @@ module.exports = (crowi) => {
       const page = await Page.findByIdAndViewer(pageId, req.user);
 
       if (page == null) {
-        const isPageExist = await Page.findById(pageId);
+        const isPageExist = await Page.count({ _id: pageId }) > 0;
         if (isPageExist) {
           // This page exists but req.user has not read permission
           return res.apiv3Err(new ErrorV3(`Haven't the right to see the page ${pageId}.`), 403);