chore: user activity in profile page (#2856)

* chore: user activity endpoint change

* chore: added workspace detail in activity serializer
This commit is contained in:
Bavisetti Narayan 2023-11-23 21:00:49 +05:30 committed by GitHub
parent c6125876be
commit dece103873
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -63,7 +63,7 @@ urlpatterns = [
name="user-tour",
),
path(
"users/workspaces/<str:slug>/activities/",
"users/me/activities/",
UserActivityEndpoint.as_view(),
name="user-activities",
),

View File

@ -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(