From a66dcb94198343aadcaeadec4636b8d82abfab4d Mon Sep 17 00:00:00 2001 From: Nikhil <118773738+pablohashescobar@users.noreply.github.com> Date: Wed, 2 Aug 2023 16:42:24 +0530 Subject: [PATCH] fix: user profiles n plus 1 (#1765) --- apiserver/plane/api/views/workspace.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apiserver/plane/api/views/workspace.py b/apiserver/plane/api/views/workspace.py index b195cedb1..a862c0b4c 100644 --- a/apiserver/plane/api/views/workspace.py +++ b/apiserver/plane/api/views/workspace.py @@ -75,6 +75,7 @@ from plane.db.models import ( Label, WorkspaceMember, CycleIssue, + IssueReaction, ) from plane.api.permissions import ( WorkSpaceBasePermission, @@ -1321,6 +1322,12 @@ class WorkspaceUserProfileIssuesEndpoint(BaseAPIView): ) .select_related("project", "workspace", "state", "parent") .prefetch_related("assignees", "labels") + .prefetch_related( + Prefetch( + "issue_reactions", + queryset=IssueReaction.objects.select_related("actor"), + ) + ) .order_by("-created_at") .annotate( link_count=IssueLink.objects.filter(issue=OuterRef("id"))