Skip to content

Commit

Permalink
refactor(decommission): delete instead of post
Browse files Browse the repository at this point in the history
  • Loading branch information
kpetremann committed Aug 21, 2024
1 parent 7afedcb commit af271b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions netbox_cmdb/netbox_cmdb/api/cmdb/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class DeleteAllCMDBObjectsRelatedToDevice(APIView):
status.HTTP_500_INTERNAL_SERVER_ERROR: "Internal Server Error: Something went wrong on the server",
},
)
def post(self, request):
def delete(self, request):
device_name = request.data.get("device_name", None)
if device_name is None:
return Response(
Expand Down Expand Up @@ -73,7 +73,7 @@ class DecommissionSite(APIView):
status.HTTP_500_INTERNAL_SERVER_ERROR: "Internal Server Error: Something went wrong on the server",
},
)
def post(self, request):
def delete(self, request):
site_name = request.data.get("site_name", None)
if site_name is None:
return Response({"error": "site name is required"}, status=status.HTTP_400_BAD_REQUEST)
Expand Down

0 comments on commit af271b2

Please sign in to comment.