Merge pull request #534 from DmytroAlipov/fix-edit-reason-olive

fix: 400 error editing posts and comment
This commit is contained in:
edX requirements bot
2023-06-12 06:04:52 -04:00
committed by GitHub
2 changed files with 6 additions and 2 deletions

View File

@@ -55,7 +55,9 @@ function CommentEditor({
const initialValues = {
comment: comment.rawBody,
editReasonCode: comment?.lastEdit?.reasonCode || (userIsStaff ? 'violates-guidelines' : ''),
editReasonCode: comment?.lastEdit?.reasonCode || (
userIsStaff && canDisplayEditReason ? 'violates-guidelines' : undefined
),
};
const handleCloseEditor = (resetForm) => {

View File

@@ -138,7 +138,9 @@ function PostEditor({
follow: isEmpty(post?.following) ? true : post?.following,
anonymous: allowAnonymous ? false : undefined,
anonymousToPeers: allowAnonymousToPeers ? false : undefined,
editReasonCode: post?.lastEdit?.reasonCode || (userIsStaff ? 'violates-guidelines' : ''),
editReasonCode: post?.lastEdit?.reasonCode || (
userIsStaff && canDisplayEditReason ? 'violates-guidelines' : undefined
),
cohort: post?.cohort || 'default',
};