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