Shun Miyazawa před 4 roky
rodič
revize
87267efc3b

+ 1 - 0
packages/app/src/server/models/revision.js

@@ -16,6 +16,7 @@ module.exports = function(crowi) {
     pageId: { type: ObjectId, required: true, index: true },
     pageId: { type: ObjectId, required: true, index: true },
     body: {
     body: {
       type: String,
       type: String,
+      require: true,
       get: (data) => {
       get: (data) => {
       // replace CR/CRLF to LF above v3.1.5
       // replace CR/CRLF to LF above v3.1.5
       // see https://github.com/weseek/growi/issues/463
       // see https://github.com/weseek/growi/issues/463

+ 1 - 1
packages/app/src/server/routes/page.js

@@ -900,7 +900,7 @@ module.exports = function(crowi, app) {
    * - If revision_id is not specified => force update by the new contents.
    * - If revision_id is not specified => force update by the new contents.
    */
    */
   api.update = async function(req, res) {
   api.update = async function(req, res) {
-    const pageBody = (typeof (req.body.body) === 'string' || req.body.body instanceof String) ? req.body.body : null;
+    const pageBody = body ?? null;
     const pageId = req.body.page_id || null;
     const pageId = req.body.page_id || null;
     const revisionId = req.body.revision_id || null;
     const revisionId = req.body.revision_id || null;
     const grant = req.body.grant || null;
     const grant = req.body.grant || null;