chore: update user activity endpoint to return only workspace activities (#1980)

This commit is contained in:
Nikhil 2023-08-29 13:35:13 +05:30 committed by GitHub
parent 8581226e60
commit 3a41ec7442
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

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

View File

@ -137,11 +137,11 @@ class UpdateUserTourCompletedEndpoint(BaseAPIView):
class UserActivityEndpoint(BaseAPIView, BasePaginator): class UserActivityEndpoint(BaseAPIView, BasePaginator):
def get(self, request): def get(self, request, slug):
try: try:
queryset = IssueActivity.objects.filter(actor=request.user).select_related( queryset = IssueActivity.objects.filter(
"actor", "workspace", "issue", "project" actor=request.user, workspace__slug=slug
) ).select_related("actor", "workspace", "issue", "project")
return self.paginate( return self.paginate(
request=request, request=request,