diff --git a/apiserver/plane/api/views/issue.py b/apiserver/plane/api/views/issue.py index 95e598dae..32d80ecf7 100644 --- a/apiserver/plane/api/views/issue.py +++ b/apiserver/plane/api/views/issue.py @@ -362,6 +362,12 @@ class UserWorkSpaceIssues(BaseAPIView): .annotate(count=Func(F("id"), function="Count")) .values("count") ) + .prefetch_related( + Prefetch( + "issue_reactions", + queryset=IssueReaction.objects.select_related("actor"), + ) + ) .filter(**filters) ) @@ -744,6 +750,12 @@ class SubIssuesEndpoint(BaseAPIView): .annotate(count=Func(F("id"), function="Count")) .values("count") ) + .prefetch_related( + Prefetch( + "issue_reactions", + queryset=IssueReaction.objects.select_related("actor"), + ) + ) ) state_distribution = ( diff --git a/apiserver/plane/api/views/view.py b/apiserver/plane/api/views/view.py index 874bb94fb..32ba24c8b 100644 --- a/apiserver/plane/api/views/view.py +++ b/apiserver/plane/api/views/view.py @@ -19,6 +19,7 @@ from plane.db.models import ( IssueView, Issue, IssueViewFavorite, + IssueReaction, ) from plane.utils.issue_filters import issue_filters @@ -77,6 +78,12 @@ class ViewIssuesEndpoint(BaseAPIView): .select_related("parent") .prefetch_related("assignees") .prefetch_related("labels") + .prefetch_related( + Prefetch( + "issue_reactions", + queryset=IssueReaction.objects.select_related("actor"), + ) + ) ) serializer = IssueLiteSerializer(issues, many=True)