diff --git a/docs/source/api/v3/servicecategories.rst b/docs/source/api/v3/servicecategories.rst index 3ec970807a..8508ff9e62 100644 --- a/docs/source/api/v3/servicecategories.rst +++ b/docs/source/api/v3/servicecategories.rst @@ -160,3 +160,54 @@ Response Structure "tenant": null } } + +``DELETE`` +========== +Deletes a specific :term:`Service Category`. + +:Auth. Required: Yes +:Roles Required: "admin" or "operations" +:Response Type: ``undefined`` + + +Request Structure +----------------- + +.. code-block:: http + :caption: Request Example + + DELETE /api/3.0/service_categories/my-service-category HTTP/1.1 + User-Agent: python-requests/2.23.0 + Accept-Encoding: gzip, deflate + Accept: */* + Connection: keep-alive + Cookie: mojolicious=... + Content-Length: 0 + +Response Structure +------------------ + +.. code-block:: http + :caption: Response Example + + HTTP/1.1 200 OK + Access-Control-Allow-Credentials: true + Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Set-Cookie, Cookie + Access-Control-Allow-Methods: POST,GET,OPTIONS,PUT,DELETE + Access-Control-Allow-Origin: * + Content-Encoding: gzip + Content-Type: application/json + Set-Cookie: mojolicious=...; Path=/; Expires=Mon, 17 Aug 2020 16:13:31 GMT; Max-Age=3600; HttpOnly + Whole-Content-Sha512: yErJobzG9IA0khvqZQK+Yi7X4pFVvOqxn6PjrdzN5DnKVm/K8Kka3REul1XmKJnMXVRY8RayoEVGDm16mBFe4Q== + X-Server-Name: traffic_ops_golang/ + Date: Mon, 17 Aug 2020 15:13:31 GMT + Content-Length: 93 + + { + "alerts": [ + { + "text": "serviceCategory was deleted.", + "level": "success" + } + ] + } diff --git a/traffic_portal/app/src/common/modules/form/serviceCategory/edit/FormEditServiceCategoryController.js b/traffic_portal/app/src/common/modules/form/serviceCategory/edit/FormEditServiceCategoryController.js index 940e77715f..8d078dc11a 100644 --- a/traffic_portal/app/src/common/modules/form/serviceCategory/edit/FormEditServiceCategoryController.js +++ b/traffic_portal/app/src/common/modules/form/serviceCategory/edit/FormEditServiceCategoryController.js @@ -60,7 +60,7 @@ var FormEditServiceCategoryController = function(serviceCategory, $scope, $contr } }); modalInstance.result.then(function() { - deleteServiceCategory(serviceCategory.name); + deleteServiceCategory(serviceCategory); }, function () { // do nothing });