remove: state delete issue validation endpoint (#929)
This commit is contained in:
parent
0be6738715
commit
48e77ea81b
3 changed files with 1 additions and 26 deletions
|
|
@ -42,7 +42,7 @@ from .workspace import (
|
|||
UserWorkspaceDashboardEndpoint,
|
||||
WorkspaceThemeViewSet,
|
||||
)
|
||||
from .state import StateViewSet, StateDeleteIssueCheckEndpoint
|
||||
from .state import StateViewSet
|
||||
from .shortcut import ShortCutViewSet
|
||||
from .view import IssueViewViewSet, ViewIssuesEndpoint, IssueViewFavoriteViewSet
|
||||
from .cycle import (
|
||||
|
|
|
|||
|
|
@ -103,22 +103,3 @@ class StateViewSet(BaseViewSet):
|
|||
return Response(status=status.HTTP_204_NO_CONTENT)
|
||||
except State.DoesNotExist:
|
||||
return Response({"error": "State does not exists"}, status=status.HTTP_404)
|
||||
|
||||
|
||||
class StateDeleteIssueCheckEndpoint(BaseAPIView):
|
||||
permission_classes = [
|
||||
ProjectEntityPermission,
|
||||
]
|
||||
|
||||
def get(self, request, slug, project_id, pk):
|
||||
try:
|
||||
issue_count = Issue.objects.filter(
|
||||
state=pk, workspace__slug=slug, project_id=project_id
|
||||
).count()
|
||||
return Response({"issue_count": issue_count}, 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_400_BAD_REQUEST,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue