From 614ccdec87bae4f72edf39b57f9fe0c9bca886b8 Mon Sep 17 00:00:00 2001 From: Syndesi Date: Sun, 10 Sep 2023 19:57:50 +0200 Subject: [PATCH] wip --- .markdownlintrc | 1 + docs/api-endpoints/element/delete-element.md | 150 ++++++++++++++++++- docs/api-endpoints/user/post-token.md | 1 - 3 files changed, 149 insertions(+), 3 deletions(-) diff --git a/.markdownlintrc b/.markdownlintrc index 2ecbea0b..03b27506 100755 --- a/.markdownlintrc +++ b/.markdownlintrc @@ -2,5 +2,6 @@ "default": true, "MD013": false, "MD033": false, + "MD038": false, "MD041": false } diff --git a/docs/api-endpoints/element/delete-element.md b/docs/api-endpoints/element/delete-element.md index b9f12ed3..1e18a8fa 100644 --- a/docs/api-endpoints/element/delete-element.md +++ b/docs/api-endpoints/element/delete-element.md @@ -1,5 +1,151 @@ # DELETE` / -` Delete Element -Deletes a single element. If the delted element is a node, all connected relationships are deleted. + + -Note: In order to avoid orphaned nodes, children need to be deleted first or get other parents added. +Deletes a single element. If the deleted element is a node, all connected relationships are deleted. + +!> **Note**: In order to avoid orphaned nodes, children need to be deleted first or get other parents added. +This behaviour might be changed, see issue [#64: HTTP DELETE /<uuid> - DeleteElementController](https://github.com/ember-nexus/api/issues/64). + +## Request Example + +```bash +curl \ + -X DELETE + -H "Authorization: Bearer secret-token:PIPeJGUt7c00ENn8a5uDlc" \ + https://api.localhost/2f99440e-ca4c-4e83-bf86-1cd27a4b1b70 +``` + + + +### **Success 204** + +The element is now deleted. No content is returned. + +### **Error 401** + +This error can only be thrown, if the token is invalid or if there is no default anonymous user. + +```problem+json +{ + "type": "Invalid authorization token", + "title": "Unauthorized", + "status": "401", + "detail": "Request requires authorization." +} +``` + +### **Error 404** + +Error 404 is thrown if the element to be deleted does not exist, or if the use does not have permissions to delete the +element. + +```problem+json +{ + "type": "Invalid authorization token", + "title": "wip", + "status": "404", + "detail": "wip" +} +``` + +### **Error 429** + +```problem+json +{ + "type": "429-too-many-requests", + "title": "Too Many Requests", + "status": "429", + "detail": "The client sent too many requests in a given timeframe; rate limiting is active." +} +``` + + + + + +## Internal Workflow + +Once the server receives such a request, it checks several things internally: + +
+ + + + diff --git a/docs/api-endpoints/user/post-token.md b/docs/api-endpoints/user/post-token.md index b984bcaa..771f4b17 100644 --- a/docs/api-endpoints/user/post-token.md +++ b/docs/api-endpoints/user/post-token.md @@ -160,4 +160,3 @@ renderWorkflow(document.getElementById('graph-container-1'), { ], }, 'TB'); -