From 7f769b4755c3ff4dd26ea372829b2e585706924f Mon Sep 17 00:00:00 2001 From: Muhammad Adeel Tajamul <77053848+muhammadadeeltajamul@users.noreply.github.com> Date: Fri, 10 Mar 2023 19:01:01 +0500 Subject: [PATCH] feat: added reverse_order option in comments sort (#31906) Co-authored-by: adeel.tajamul --- lms/djangoapps/discussion/rest_api/api.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lms/djangoapps/discussion/rest_api/api.py b/lms/djangoapps/discussion/rest_api/api.py index dc2d1e314dac..f480fb31fe2b 100644 --- a/lms/djangoapps/discussion/rest_api/api.py +++ b/lms/djangoapps/discussion/rest_api/api.py @@ -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":