mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
fix: state response change
This commit is contained in:
parent
7e95b8f160
commit
4761d4e0e9
@ -83,6 +83,7 @@ from plane.utils.grouper import group_results
|
||||
from plane.utils.issue_filters import issue_filters
|
||||
from collections import defaultdict
|
||||
|
||||
|
||||
class IssueViewSet(WebhookMixin, BaseViewSet):
|
||||
def get_serializer_class(self):
|
||||
return (
|
||||
@ -711,10 +712,15 @@ class LabelViewSet(BaseViewSet):
|
||||
|
||||
def list(self, request, slug, project_id):
|
||||
labels = Label.objects.filter(
|
||||
workspace__slug=slug,
|
||||
project_id=project_id
|
||||
workspace__slug=slug, project_id=project_id
|
||||
).values(
|
||||
"parent", "name", "color", "id", "project_id", "workspace__slug"
|
||||
"parent",
|
||||
"name",
|
||||
"color",
|
||||
"id",
|
||||
"project_id",
|
||||
"workspace__slug",
|
||||
"sort_order",
|
||||
)
|
||||
return Response(labels, status=status.HTTP_200_OK)
|
||||
|
||||
@ -830,7 +836,9 @@ class SubIssuesEndpoint(BaseAPIView):
|
||||
|
||||
_ = Issue.objects.bulk_update(sub_issues, ["parent"], batch_size=10)
|
||||
|
||||
updated_sub_issues = Issue.issue_objects.filter(id__in=sub_issue_ids).annotate(state_group=F("state__group"))
|
||||
updated_sub_issues = Issue.issue_objects.filter(
|
||||
id__in=sub_issue_ids
|
||||
).annotate(state_group=F("state__group"))
|
||||
|
||||
# Track the issue
|
||||
_ = [
|
||||
@ -864,7 +872,6 @@ class SubIssuesEndpoint(BaseAPIView):
|
||||
)
|
||||
|
||||
|
||||
|
||||
class IssueLinkViewSet(BaseViewSet):
|
||||
permission_classes = [
|
||||
ProjectEntityPermission,
|
||||
|
@ -49,7 +49,9 @@ class StateViewSet(BaseViewSet):
|
||||
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
|
||||
|
||||
def list(self, request, slug, project_id):
|
||||
states = StateSerializer(self.get_queryset(), many=True).data
|
||||
states = State.objects.filter(workspace__slug=slug, project_id=project_id).values(
|
||||
"id", "project_id", "workspace__slug", "name", "color", "group"
|
||||
)
|
||||
grouped = request.GET.get("grouped", False)
|
||||
if grouped == "true":
|
||||
state_dict = {}
|
||||
|
@ -1362,7 +1362,9 @@ class WorkspaceUserProfileIssuesEndpoint(BaseAPIView):
|
||||
.values("count")
|
||||
)
|
||||
.annotate(
|
||||
sub_issues_count=Issue.issue_objects.filter(parent=OuterRef("id"))
|
||||
sub_issues_count=Issue.issue_objects.filter(
|
||||
parent=OuterRef("id")
|
||||
)
|
||||
.order_by()
|
||||
.annotate(count=Func(F("id"), function="Count"))
|
||||
.values("count")
|
||||
@ -1446,7 +1448,13 @@ class WorkspaceLabelsEndpoint(BaseAPIView):
|
||||
workspace__slug=slug,
|
||||
project__project_projectmember__member=request.user,
|
||||
).values(
|
||||
"parent", "name", "color", "id", "project_id", "workspace__slug"
|
||||
"parent",
|
||||
"name",
|
||||
"color",
|
||||
"id",
|
||||
"project_id",
|
||||
"workspace__slug",
|
||||
"sort_order",
|
||||
)
|
||||
return Response(labels, status=status.HTTP_200_OK)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user