From 8d6082183ef8003a53665512ab1effcc78a1433b Mon Sep 17 00:00:00 2001 From: pablohashescobar <118773738+pablohashescobar@users.noreply.github.com> Date: Mon, 15 May 2023 19:38:08 +0530 Subject: [PATCH] chore: return assignee avatars when x axis in assignee_email (#1049) --- apiserver/plane/api/views/analytic.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apiserver/plane/api/views/analytic.py b/apiserver/plane/api/views/analytic.py index e054678fe..bd9ea69bf 100644 --- a/apiserver/plane/api/views/analytic.py +++ b/apiserver/plane/api/views/analytic.py @@ -76,11 +76,17 @@ class AnalyticsEndpoint(BaseAPIView): ) ) + assignee_avatars = {} + if x_axis in ["assignees__email"]: + assignee_avatars = Issue.objects.filter( + workspace__slug=slug, **filters + ).values("assignees__avatar") + return Response( { "total": total_issues, "distribution": distribution, - "extras": {"colors": colors}, + "extras": {"colors": colors, "assignee_avatars": assignee_avatars}, }, status=status.HTTP_200_OK, )