Merge pull request #535 from DmytroAlipov/fix-edit-reason-palm

fix: 400 error editing comment
This commit is contained in:
edX requirements bot
2023-06-12 06:05:04 -04:00
committed by GitHub

View File

@@ -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) => {