From 39f54d82655c60dedbb06154f10fb2b2474f7184 Mon Sep 17 00:00:00 2001 From: pablohashescobar <118773738+pablohashescobar@users.noreply.github.com> Date: Mon, 6 Mar 2023 18:57:58 +0530 Subject: [PATCH] fix: cycle and module issue filtering (#363) --- apiserver/plane/api/views/cycle.py | 4 ++-- apiserver/plane/api/views/module.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apiserver/plane/api/views/cycle.py b/apiserver/plane/api/views/cycle.py index 9ab961de7..d3dec7588 100644 --- a/apiserver/plane/api/views/cycle.py +++ b/apiserver/plane/api/views/cycle.py @@ -120,8 +120,8 @@ class CycleIssueViewSet(BaseViewSet): def list(self, request, slug, project_id, cycle_id): try: - order_by = request.GET.get("order_by", "issue__created_at") - queryset = self.get_queryset().order_by(order_by) + order_by = request.GET.get("order_by", "created_at") + queryset = self.get_queryset().order_by(f"issue__{order_by}") group_by = request.GET.get("group_by", False) cycle_issues = CycleIssueSerializer(queryset, many=True).data diff --git a/apiserver/plane/api/views/module.py b/apiserver/plane/api/views/module.py index 48b8d0f19..2e5239768 100644 --- a/apiserver/plane/api/views/module.py +++ b/apiserver/plane/api/views/module.py @@ -145,7 +145,7 @@ class ModuleIssueViewSet(BaseViewSet): def list(self, request, slug, project_id, module_id): try: order_by = request.GET.get("order_by", "issue__created_at") - queryset = self.get_queryset().order_by(order_by) + queryset = self.get_queryset().order_by(f"issue__{order_by}") group_by = request.GET.get("group_by", False) module_issues = ModuleIssueSerializer(queryset, many=True).data