openedx / cs_comments_service

server side of the comment service
GNU Affero General Public License v3.0
36 stars 155 forks source link

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

Closed 0x29a closed 1 year ago

0x29a commented 2 years ago

Description

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.
openedx-webhooks commented 2 years ago

Thanks for the pull request, @0x29a!

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

asadazam93 commented 2 years ago

@0x29a can you please rebase this?

0x29a commented 2 years ago

@asadazam93, done.

openedx-webhooks commented 1 year ago

@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.