cs_comments_service icon indicating copy to clipboard operation
cs_comments_service copied to clipboard

[BD-38][INF-544][BB-6682] feat: implement reverse_order parameter

Open 0x29a opened this issue 3 years ago • 1 comments

Description

  • Added reverse_order query parameter to the threads endpoint.
  • Modified merge_response_content to support reversed content order.

Testing instructions

  1. Open Discussion for some course.
  2. Create a discussion, add two responses, add comments for both of them.
  3. Specify the thread ID (you can find it in the address bar) and course ID, and run the following (httpie used):
    http http://127.0.0.1:4567/api/v1/threads/<YOUR_THREAD_ID> "X-EDX-API-KEY: forumapikey" course_id==<YOUR_COURSE_ID> with_responses==True user_id==4 mark_as_read==False recursive==True resp_skip==0 reverse_order==false
    
    You should see a thread with comments ordered by the creation date.
  4. Run the command from the previous point, but change reverse_order==false to reverse_order==true. You should see threads and comments in the reversed order.
  5. You can specify resp_limit==1 to verify that the reverse ordering works with pagination.

0x29a avatar Oct 31 '22 03:10 0x29a

Thanks for the pull request, @0x29a!

When this pull request is ready, tag your edX technical lead.

openedx-webhooks avatar Oct 31 '22 03:10 openedx-webhooks

@0x29a can you please rebase this?

asadazam93 avatar Nov 08 '22 10:11 asadazam93

@asadazam93, done.

0x29a avatar Nov 08 '22 12:11 0x29a

@0x29a 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

openedx-webhooks avatar Nov 15 '22 10:11 openedx-webhooks