openedx / frontend-app-discussions

A React-based micro frontend for the Open edX discussion forums.
GNU Affero General Public License v3.0
6 stars 62 forks source link

fix: error 400 editing comment #533

Closed DmytroAlipov closed 1 year ago

DmytroAlipov commented 1 year ago

Description

When trying to edit a comment, an error 400 occurred. Provided that the user is a course instructor or staff, and simultaneously the author of the comment.

The issue is the presence of the editReasonCode parameter in the request.

discussion_mfe_bug

This parameter is expected only if the editor is not the author of the post/comment, and is a staff or instructor.

After the fixes, everything works correctly.

discussion_mfe_fix

NOTE: Similar changes were made to fix the post editing error.

Post-merge Checklist

openedx-webhooks commented 1 year ago

Thanks for the pull request, @DmytroAlipov! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (a02771f) 91.86% compared to head (b4d236a) 91.86%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #533 +/- ## ======================================= Coverage 91.86% 91.86% ======================================= Files 170 170 Lines 3468 3468 Branches 904 904 ======================================= Hits 3186 3186 Misses 263 263 Partials 19 19 ``` | [Impacted Files](https://app.codecov.io/gh/openedx/frontend-app-discussions/pull/533?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openedx) | Coverage Ξ” | | |---|---|---| | [...s/post-comments/comments/comment/CommentEditor.jsx](https://app.codecov.io/gh/openedx/frontend-app-discussions/pull/533?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openedx#diff-c3JjL2Rpc2N1c3Npb25zL3Bvc3QtY29tbWVudHMvY29tbWVudHMvY29tbWVudC9Db21tZW50RWRpdG9yLmpzeA==) | `90.69% <100.00%> (ΓΈ)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

mphilbrick211 commented 1 year ago

Hi @asadazam93! Would you mind reviewing and merging if all looks good? Thanks!

awais-ansari commented 1 year ago

@DmytroAlipov Thanks for your contribution. The Team will review your PR very soon and let you know about it.

awais-ansari commented 1 year ago

@DmytroAlipov Please rebase this PR.

DmytroAlipov commented 1 year ago

@awais-ansari done

openedx-webhooks commented 1 year ago

@DmytroAlipov πŸŽ‰ Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.