Skip to content

Commit

Permalink
feat: added reverse_order option in comments sort (#31906)
Browse files Browse the repository at this point in the history
Co-authored-by: adeel.tajamul <[email protected]>
  • Loading branch information
muhammadadeeltajamul and adeel.tajamul authored Mar 10, 2023
1 parent 2ca95e5 commit 7f769b4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lms/djangoapps/discussion/rest_api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1646,12 +1646,14 @@ def get_response_comments(request, comment_id, page, page_size, requested_fields
"""
try:
cc_comment = Comment(id=comment_id).retrieve()
reverse_order = request.GET.get('reverse_order', False)
cc_thread, context = _get_thread_and_context(
request,
cc_comment["thread_id"],
retrieve_kwargs={
"with_responses": True,
"recursive": True,
"reverse_order": reverse_order,
}
)
if cc_thread["thread_type"] == "question":
Expand Down

0 comments on commit 7f769b4

Please sign in to comment.