Skip to content

Commit

Permalink
Fix indexing content from Emacs #883 from aam-at/bugfix/fix_emacs_if
Browse files Browse the repository at this point in the history
Previously `force' was passed as a query param to the single indexing API. After the recent API updates, it is meant to select the API method to use (PATCH vs PATCH). Converting `force' argument to a bool fixes implementing this new behavior
  • Loading branch information
debanjum committed Aug 16, 2024
2 parents 0b568e2 + f16b0f6 commit 2b1482d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/interface/emacs/khoj.el
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ Auto invokes setup steps on calling main entrypoint."
"Send multi-part form `BODY' of `CONTENT-TYPE' in request to khoj server.
Append 'TYPE-QUERY' as query parameter in request url.
Specify `BOUNDARY' used to separate files in request header."
(let ((url-request-method ((if force) "PUT" "PATCH"))
(let ((url-request-method (if force "PUT" "PATCH"))
(url-request-data body)
(url-request-extra-headers `(("content-type" . ,(format "multipart/form-data; boundary=%s" boundary))
("Authorization" . ,(format "Bearer %s" khoj-api-key)))))
Expand Down Expand Up @@ -1266,7 +1266,7 @@ Paragraph only starts at first text after blank line."
(transient-define-suffix khoj--update-command (&optional args)
"Call khoj API to update index of specified content type."
(interactive (list (transient-args transient-current-command)))
(let* ((force-update (if (member "--force-update" args) "true" "false"))
(let* ((force-update (if (member "--force-update" args) t nil))
;; set content type to: specified > last used > based on current buffer > default type
(content-type (or (transient-arg-value "--content-type=" args) (khoj--buffer-name-to-content-type (buffer-name))))
(url-request-method "GET"))
Expand Down

0 comments on commit 2b1482d

Please sign in to comment.