fix: cycle and module issue filtering (#363)

This commit is contained in:
pablohashescobar 2023-03-06 18:57:58 +05:30 committed by GitHub
parent 3d57edfcf8
commit 39f54d8265
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -120,8 +120,8 @@ class CycleIssueViewSet(BaseViewSet):
def list(self, request, slug, project_id, cycle_id): def list(self, request, slug, project_id, cycle_id):
try: try:
order_by = request.GET.get("order_by", "issue__created_at") order_by = request.GET.get("order_by", "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) group_by = request.GET.get("group_by", False)
cycle_issues = CycleIssueSerializer(queryset, many=True).data cycle_issues = CycleIssueSerializer(queryset, many=True).data

View File

@ -145,7 +145,7 @@ class ModuleIssueViewSet(BaseViewSet):
def list(self, request, slug, project_id, module_id): def list(self, request, slug, project_id, module_id):
try: try:
order_by = request.GET.get("order_by", "issue__created_at") 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) group_by = request.GET.get("group_by", False)
module_issues = ModuleIssueSerializer(queryset, many=True).data module_issues = ModuleIssueSerializer(queryset, many=True).data