aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/client.lisp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/client.lisp b/lib/client.lisp
index a72b991..6883b20 100644
--- a/lib/client.lisp
+++ b/lib/client.lisp
@@ -195,11 +195,9 @@ running the body. If such a oneliner can be found."
;;; EDITING ONELINERS
-(defun edit-item (ident)
+(defun edit-item (ident &optional draftp)
(api-token) ;; fails with error if not set.
- (when-oneliner (ol ident)
- ;; Like adding a oneliner, read each field in from a prompt.
- ;; Here, prefil the field with its current value.
+ (let ((ol (if draftp (fetch-draft ident) (the-oneliner ident))))
(let* ((oneliner-string
(prompt "Oneliner: "
:expect 'valid-oneliner-string-p
@@ -270,7 +268,7 @@ running the body. If such a oneliner can be found."
(:body (oneliner-to-json-body local)
:content-type "application/json")
(api:patch--oneliner-entry-edit (oneliner-id ol) :token (api-token))
- ;(merge-oneliners (list new-item)) ;;TODO: this is broken, wait for API update.
+ ;(merge-oneliners (list new-item)) ;;TODO: this is broken, wait for API update.
(format t "Edits accepted~%")))))))
(defun publish-draft (name)