From e801fbb5cda33e477c34b52d4b0acb6bb0ef68d4 Mon Sep 17 00:00:00 2001 From: alipov_d Date: Wed, 7 Jun 2023 14:11:45 +0200 Subject: [PATCH] fix: 400 error editing comment This is a backport from the master --- .../post-comments/comments/comment/CommentEditor.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/discussions/post-comments/comments/comment/CommentEditor.jsx b/src/discussions/post-comments/comments/comment/CommentEditor.jsx index 66750387..de318954 100644 --- a/src/discussions/post-comments/comments/comment/CommentEditor.jsx +++ b/src/discussions/post-comments/comments/comment/CommentEditor.jsx @@ -58,7 +58,9 @@ const CommentEditor = ({ const initialValues = { comment: comment.rawBody, // eslint-disable-next-line react/prop-types - editReasonCode: comment?.lastEdit?.reasonCode || (userIsStaff ? 'violates-guidelines' : ''), + editReasonCode: comment?.lastEdit?.reasonCode || ( + userIsStaff && canDisplayEditReason ? 'violates-guidelines' : undefined + ), }; const handleCloseEditor = (resetForm) => {