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,
|
BulkDeleteIssuesEndpoint,
|
||||||
BulkAssignIssuesToCycleEndpoint,
|
BulkAssignIssuesToCycleEndpoint,
|
||||||
ProjectUserViewsEndpoint,
|
ProjectUserViewsEndpoint,
|
||||||
|
UserWorkSpaceIssues,
|
||||||
)
|
)
|
||||||
|
|
||||||
from plane.api.views.project import AddTeamToProjectEndpoint
|
from plane.api.views.project import AddTeamToProjectEndpoint
|
||||||
@ -495,6 +496,11 @@ urlpatterns = [
|
|||||||
"workspaces/<str:slug>/projects/<uuid:project_id>/bulk-delete-issues/",
|
"workspaces/<str:slug>/projects/<uuid:project_id>/bulk-delete-issues/",
|
||||||
BulkDeleteIssuesEndpoint.as_view(),
|
BulkDeleteIssuesEndpoint.as_view(),
|
||||||
),
|
),
|
||||||
|
path(
|
||||||
|
"workspaces/<str:slug>/me/issues/",
|
||||||
|
UserWorkSpaceIssues.as_view(),
|
||||||
|
name="workspace-issues",
|
||||||
|
),
|
||||||
## End Issues
|
## End Issues
|
||||||
## Issue Activity
|
## Issue Activity
|
||||||
path(
|
path(
|
||||||
|
@ -48,6 +48,7 @@ from .issue import (
|
|||||||
IssuePropertyViewSet,
|
IssuePropertyViewSet,
|
||||||
LabelViewSet,
|
LabelViewSet,
|
||||||
BulkDeleteIssuesEndpoint,
|
BulkDeleteIssuesEndpoint,
|
||||||
|
UserWorkSpaceIssues,
|
||||||
)
|
)
|
||||||
|
|
||||||
from .auth_extended import (
|
from .auth_extended import (
|
||||||
|
@ -173,6 +173,21 @@ class UserIssuesEndpoint(BaseAPIView):
|
|||||||
status=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
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):
|
class WorkSpaceIssuesEndpoint(BaseAPIView):
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user