itizawa %!s(int64=6) %!d(string=hai) anos
pai
achega
a68e085a34
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      src/server/routes/page.js

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

@@ -624,7 +624,7 @@ module.exports = function(crowi, app) {
     const pageBody = req.body.body || null;
     const pageId = req.body.page_id || null;
     const revisionId = req.body.revision_id || null;
-    const grant = req.body.grant || 1;
+    const grant = req.body.grant || null;
     const grantUserGroupId = req.body.grantUserGroupId || null;
     const overwriteScopesOfDescendants = req.body.overwriteScopesOfDescendants || null;
     const isSlackEnabled = !!req.body.isSlackEnabled; // cast to boolean
@@ -637,6 +637,10 @@ module.exports = function(crowi, app) {
       return res.json(ApiResponse.error('page_id and body are required.'));
     }
 
+    if (!grant) {
+      return res.json(ApiResponse.error('Grant is not selected'));
+    }
+
     // check page existence
     const isExist = await Page.count({ _id: pageId }) > 0;
     if (!isExist) {