From af271b25f758da9eae7a04eb7c34161ba5846dc6 Mon Sep 17 00:00:00 2001 From: Kevin Petremann Date: Wed, 21 Aug 2024 16:18:38 +0200 Subject: [PATCH] refactor(decommission): delete instead of post --- netbox_cmdb/netbox_cmdb/api/cmdb/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netbox_cmdb/netbox_cmdb/api/cmdb/views.py b/netbox_cmdb/netbox_cmdb/api/cmdb/views.py index 4b898d0..6e5ab14 100644 --- a/netbox_cmdb/netbox_cmdb/api/cmdb/views.py +++ b/netbox_cmdb/netbox_cmdb/api/cmdb/views.py @@ -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( @@ -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)