[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:
Bavisetti Narayan
2024-08-07 20:00:21 +05:30
committed by GitHub
parent 3dd7045252
commit 56fcd12783
4 changed files with 29 additions and 0 deletions

View File

@@ -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)

View File

@@ -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):

View File

@@ -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"},

View File

@@ -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)