From dece1038735feb6a91ca1c65b216f4b01ac736d1 Mon Sep 17 00:00:00 2001 From: Bavisetti Narayan <72156168+NarayanBavisetti@users.noreply.github.com> Date: Thu, 23 Nov 2023 21:00:49 +0530 Subject: [PATCH] chore: user activity in profile page (#2856) * chore: user activity endpoint change * chore: added workspace detail in activity serializer --- apiserver/plane/app/serializers/issue.py | 1 + apiserver/plane/app/urls/user.py | 2 +- apiserver/plane/app/views/user.py | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apiserver/plane/app/serializers/issue.py b/apiserver/plane/app/serializers/issue.py index 4477d9328..b13d03e35 100644 --- a/apiserver/plane/app/serializers/issue.py +++ b/apiserver/plane/app/serializers/issue.py @@ -225,6 +225,7 @@ class IssueActivitySerializer(BaseSerializer): actor_detail = UserLiteSerializer(read_only=True, source="actor") issue_detail = IssueFlatSerializer(read_only=True, source="issue") project_detail = ProjectLiteSerializer(read_only=True, source="project") + workspace_detail = WorkspaceLiteSerializer(read_only=True, source="workspace") class Meta: model = IssueActivity diff --git a/apiserver/plane/app/urls/user.py b/apiserver/plane/app/urls/user.py index c958addad..6189b96cb 100644 --- a/apiserver/plane/app/urls/user.py +++ b/apiserver/plane/app/urls/user.py @@ -63,7 +63,7 @@ urlpatterns = [ name="user-tour", ), path( - "users/workspaces//activities/", + "users/me/activities/", UserActivityEndpoint.as_view(), name="user-activities", ), diff --git a/apiserver/plane/app/views/user.py b/apiserver/plane/app/views/user.py index ed1178886..f8298301c 100644 --- a/apiserver/plane/app/views/user.py +++ b/apiserver/plane/app/views/user.py @@ -76,9 +76,9 @@ class UpdateUserTourCompletedEndpoint(BaseAPIView): class UserActivityEndpoint(BaseAPIView, BasePaginator): - def get(self, request, slug): + def get(self, request): queryset = IssueActivity.objects.filter( - actor=request.user, workspace__slug=slug + actor=request.user ).select_related("actor", "workspace", "issue", "project") return self.paginate(