mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
fix: segregate my issues with workspace
This commit is contained in:
parent
d2932a44a6
commit
eb85e04a09
@ -55,6 +55,7 @@ from plane.api.views import (
|
||||
BulkDeleteIssuesEndpoint,
|
||||
BulkAssignIssuesToCycleEndpoint,
|
||||
ProjectUserViewsEndpoint,
|
||||
UserWorkSpaceIssues,
|
||||
)
|
||||
|
||||
from plane.api.views.project import AddTeamToProjectEndpoint
|
||||
@ -495,6 +496,11 @@ urlpatterns = [
|
||||
"workspaces/<str:slug>/projects/<uuid:project_id>/bulk-delete-issues/",
|
||||
BulkDeleteIssuesEndpoint.as_view(),
|
||||
),
|
||||
path(
|
||||
"workspaces/<str:slug>/me/issues/",
|
||||
UserWorkSpaceIssues.as_view(),
|
||||
name="workspace-issues",
|
||||
),
|
||||
## End Issues
|
||||
## Issue Activity
|
||||
path(
|
||||
|
@ -9,7 +9,7 @@ from .project import (
|
||||
ProjectIdentifierEndpoint,
|
||||
AddMemberToProjectEndpoint,
|
||||
ProjectJoinEndpoint,
|
||||
ProjectUserViewsEndpoint,
|
||||
ProjectUserViewsEndpoint,
|
||||
)
|
||||
from .people import (
|
||||
PeopleEndpoint,
|
||||
@ -48,6 +48,7 @@ from .issue import (
|
||||
IssuePropertyViewSet,
|
||||
LabelViewSet,
|
||||
BulkDeleteIssuesEndpoint,
|
||||
UserWorkSpaceIssues,
|
||||
)
|
||||
|
||||
from .auth_extended import (
|
||||
|
@ -173,6 +173,21 @@ class UserIssuesEndpoint(BaseAPIView):
|
||||
status=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||
)
|
||||
|
||||
class UserWorkSpaceIssues(BaseAPIView):
|
||||
def get(self, request, slug):
|
||||
try:
|
||||
print(request.user)
|
||||
issues = Issue.objects.filter(
|
||||
assignees__in=[request.user], workspace__slug=slug
|
||||
)
|
||||
serializer = IssueSerializer(issues, many=True)
|
||||
return Response(serializer.data, status=status.HTTP_200_OK)
|
||||
except Exception as e:
|
||||
capture_exception(e)
|
||||
return Response(
|
||||
{"error": "Something went wrong please try again later"},
|
||||
status=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||
)
|
||||
|
||||
class WorkSpaceIssuesEndpoint(BaseAPIView):
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user