Browse Source

Add a delete document function

elexandria
Damien Cassou 3 years ago
parent
commit
164a6f65ce
No known key found for this signature in database GPG Key ID: A7123815F5DCE914
1 changed files with 12 additions and 0 deletions
  1. +12
    -0
      libelcouch.el

+ 12
- 0
libelcouch.el View File

@ -207,5 +207,17 @@ considered to have failed."
:error #'libelcouch--request-error)
nil)
(defun libelcouch-document-delete (document revision function)
"Delete DOCUMENT at REVISION and evaluate FUNCTION."
(request
(url-encode-url (libelcouch-entity-url document))
:type "DELETE"
:params `(("rev" . ,revision))
:headers '(("Content-Type" . "application/json")
("Accept" . "application/json"))
:success (cl-function (lambda (&rest _args) (funcall function)))
:error #'libelcouch--request-error)
nil)
(provide 'libelcouch)
;;; libelcouch.el ends here

Loading…
Cancel
Save