mirror of
https://github.com/makeplane/plane.git
synced 2026-07-13 05:49:40 +02:00
[WEB-2181] chore: deploy board deletion (#759)
* chore: deploy board deletion * chore: page publish deletion * chore: added project deletion validation --------- Co-authored-by: sriram veeraghanta <veeraghanta.sriram@gmail.com>
This commit is contained in:
committed by
GitHub
parent
3dd7045252
commit
56fcd12783
@@ -374,6 +374,12 @@ class PageViewSet(BaseViewSet):
|
||||
entity_identifier=pk,
|
||||
entity_type="page",
|
||||
).delete()
|
||||
# Delete the deploy board
|
||||
DeployBoard.objects.get(
|
||||
entity_name="page",
|
||||
entity_identifier=pk,
|
||||
workspace__slug=slug,
|
||||
).delete()
|
||||
return Response(status=status.HTTP_204_NO_CONTENT)
|
||||
|
||||
|
||||
|
||||
@@ -456,6 +456,16 @@ class ProjectViewSet(BaseViewSet):
|
||||
status=status.HTTP_410_GONE,
|
||||
)
|
||||
|
||||
def destroy(self, request, slug, pk):
|
||||
project = Project.objects.get(pk=pk)
|
||||
project.delete()
|
||||
DeployBoard.objects.get(
|
||||
entity_name="project",
|
||||
entity_identifier=pk,
|
||||
workspace__slug=slug,
|
||||
).delete()
|
||||
return Response(status=status.HTTP_204_NO_CONTENT)
|
||||
|
||||
|
||||
class ProjectArchiveUnarchiveEndpoint(BaseAPIView):
|
||||
|
||||
|
||||
@@ -460,6 +460,13 @@ class IssueViewViewSet(BaseViewSet):
|
||||
entity_identifier=pk,
|
||||
entity_type="view",
|
||||
).delete()
|
||||
# Delete the view from the deploy board
|
||||
DeployBoard.objects.filter(
|
||||
entity_name="view",
|
||||
entity_identifier=pk,
|
||||
project_id=project_id,
|
||||
workspace__slug=slug,
|
||||
).delete()
|
||||
else:
|
||||
return Response(
|
||||
{"error": "Only admin or owner can delete the view"},
|
||||
|
||||
@@ -336,6 +336,12 @@ class WorkspacePageViewSet(BaseViewSet):
|
||||
)
|
||||
|
||||
page.delete()
|
||||
# Delete the deploy board
|
||||
DeployBoard.objects.get(
|
||||
entity_name="page",
|
||||
entity_identifier=pk,
|
||||
workspace__slug=slug,
|
||||
).delete()
|
||||
return Response(status=status.HTTP_204_NO_CONTENT)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user