From 5531288c433641d81d1359e0afa69f86d4bf5d07 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Sun, 13 Mar 2022 14:24:16 -0500 Subject: can also edit drafts --- lib/client.lisp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib') 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) -- cgit v1.2.3