瀏覽代碼

fix parsing body

Yuki Takei 1 年之前
父節點
當前提交
4dab8cc843
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      apps/app/src/server/routes/comment.js

+ 3 - 3
apps/app/src/server/routes/comment.js

@@ -368,9 +368,9 @@ module.exports = function(crowi, app) {
   api.update = async function(req, res) {
     const { commentForm } = req.body;
 
-    const commentStr = commentForm.comment;
-    const commentId = commentForm.comment_id;
-    const revision = commentForm.revision_id;
+    const commentStr = commentForm?.comment;
+    const commentId = commentForm?.comment_id;
+    const revision = commentForm?.revision_id;
 
     if (commentStr === '') {
       return res.json(ApiResponse.error('Comment text is required'));