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: 400 error editing posts and comment #534

Closed DmytroAlipov closed 1 year ago

DmytroAlipov commented 1 year ago

This is a backport from the master and and this PR

Description

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

discussion_mfe_bug_2

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

discussion_mfe_bug_1

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

Merge Checklist

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 project coverage change: +0.01 :tada:

Comparison is base (7dfbd44) 85.06% compared to head (2563209) 85.07%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## open-release/olive.master #534 +/- ## ============================================================= + Coverage 85.06% 85.07% +0.01% ============================================================= Files 134 134 Lines 2678 2680 +2 Branches 741 743 +2 ============================================================= + Hits 2278 2280 +2 Misses 378 378 Partials 22 22 ``` | [Impacted Files](https://app.codecov.io/gh/openedx/frontend-app-discussions/pull/534?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openedx) | Coverage Ξ” | | |---|---|---| | [src/discussions/comments/comment/CommentEditor.jsx](https://app.codecov.io/gh/openedx/frontend-app-discussions/pull/534?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openedx#diff-c3JjL2Rpc2N1c3Npb25zL2NvbW1lbnRzL2NvbW1lbnQvQ29tbWVudEVkaXRvci5qc3g=) | `97.50% <100.00%> (+0.06%)` | :arrow_up: | | [src/discussions/posts/PostsList.jsx](https://app.codecov.io/gh/openedx/frontend-app-discussions/pull/534?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openedx#diff-c3JjL2Rpc2N1c3Npb25zL3Bvc3RzL1Bvc3RzTGlzdC5qc3g=) | `97.29% <100.00%> (ΓΈ)` | | | [src/discussions/posts/post-editor/PostEditor.jsx](https://app.codecov.io/gh/openedx/frontend-app-discussions/pull/534?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openedx#diff-c3JjL2Rpc2N1c3Npb25zL3Bvc3RzL3Bvc3QtZWRpdG9yL1Bvc3RFZGl0b3IuanN4) | `85.29% <100.00%> (+0.14%)` | :arrow_up: |

: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/merging? 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.

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.