dev: fix issues endpoint

This commit is contained in:
pablohashescobar 2024-02-19 20:47:59 +05:30
parent 27cc4c8f9b
commit f89e415bca

View File

@ -87,8 +87,8 @@ class IssueListEndpoint(BaseAPIView):
ProjectEntityPermission, ProjectEntityPermission,
] ]
def post(self, request, slug, project_id): def get(self, request, slug, project_id):
issues = request.data.get("issues", []) issues = request.GET.get("issues", False)
if not issues: if not issues:
return Response( return Response(
@ -96,6 +96,8 @@ class IssueListEndpoint(BaseAPIView):
status=status.HTTP_400_BAD_REQUEST, status=status.HTTP_400_BAD_REQUEST,
) )
issues = [issue for issue in issues.split(",") if issue != ""]
queryset = ( queryset = (
Issue.issue_objects.filter( Issue.issue_objects.filter(
workspace__slug=slug, project_id=project_id, pk__in=issues workspace__slug=slug, project_id=project_id, pk__in=issues
@ -147,7 +149,7 @@ class IssueListEndpoint(BaseAPIView):
order_by_param = request.GET.get("order_by", "-created_at") order_by_param = request.GET.get("order_by", "-created_at")
issue_queryset = self.get_queryset().filter(**filters) issue_queryset = queryset.filter(**filters)
# Priority Ordering # Priority Ordering
if order_by_param == "priority" or order_by_param == "-priority": if order_by_param == "priority" or order_by_param == "-priority":