fix: issue serializer

This commit is contained in:
pablohashescobar 2022-12-22 15:53:29 +05:30
parent 49fc8caf5a
commit 3325a28921
2 changed files with 9 additions and 1 deletions

View File

@ -384,7 +384,7 @@ class IssueSerializer(BaseSerializer):
blocked_issues = BlockedIssueSerializer(read_only=True, many=True)
blocker_issues = BlockerIssueSerializer(read_only=True, many=True)
issue_cycle = IssueCycleDetailSerializer(read_only=True)
issue_module = IssueModuleDetailSerializer(read_only=True)
issue_module = IssueModuleDetailSerializer(read_only=True, many=True)
class Meta:
model = Issue

View File

@ -37,6 +37,7 @@ from plane.db.models import (
Label,
IssueBlocker,
CycleIssue,
ModuleIssue
)
@ -96,6 +97,12 @@ class IssueViewSet(BaseViewSet):
queryset=CycleIssue.objects.select_related("cycle", "issue"),
),
)
.prefetch_related(
Prefetch(
"issue_module",
queryset=ModuleIssue.objects.select_related("module", "issue"),
),
)
)
def grouper(self, issue, group_by):
@ -175,6 +182,7 @@ class UserWorkSpaceIssues(BaseAPIView):
status=status.HTTP_500_INTERNAL_SERVER_ERROR,
)
class WorkSpaceIssuesEndpoint(BaseAPIView):
permission_classes = [