mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
dev: optimize public issues list endpoint
This commit is contained in:
parent
a50cf266bd
commit
cf706b7977
@ -561,7 +561,7 @@ class CommentReactionSerializer(BaseSerializer):
|
||||
class IssueVoteSerializer(BaseSerializer):
|
||||
class Meta:
|
||||
model = IssueVote
|
||||
fields = ["issue", "vote", "workspace_id", "project_id", "actor"]
|
||||
fields = ["issue", "vote", "workspace", "project", "actor",]
|
||||
read_only_fields = fields
|
||||
|
||||
|
||||
|
@ -2060,6 +2060,12 @@ class ProjectIssuesPublicEndpoint(BaseAPIView):
|
||||
queryset=IssueReaction.objects.select_related("actor"),
|
||||
)
|
||||
)
|
||||
.prefetch_related(
|
||||
Prefetch(
|
||||
"votes",
|
||||
queryset=IssueVote.objects.select_related("actor"),
|
||||
)
|
||||
)
|
||||
.filter(**filters)
|
||||
.annotate(cycle_id=F("issue_cycle__cycle_id"))
|
||||
.annotate(module_id=F("issue_module__module_id"))
|
||||
|
Loading…
Reference in New Issue
Block a user