Fix triggering index update on khoj server from khoj.el

This commit is contained in:
Debanjum Singh Solanky 2023-07-18 19:32:06 -07:00
parent 5c7d7f558d
commit 4d910936b7

View file

@ -624,7 +624,7 @@ CONFIG is json obtained from Khoj config API."
(buffer-string))) (buffer-string)))
;; Update index on khoj server after configuration update ;; Update index on khoj server after configuration update
(let ((khoj--server-ready? nil)) (let ((khoj--server-ready? nil))
(url-retrieve (format "%s/api/update?t=org&client=emacs" khoj-server-url) #'identity))) (url-retrieve (format "%s/api/update?client=emacs" khoj-server-url) #'identity)))
(defun khoj--get-enabled-content-types () (defun khoj--get-enabled-content-types ()
"Get content types enabled for search from API." "Get content types enabled for search from API."
@ -1032,7 +1032,8 @@ Paragraph only starts at first text after blank line."
(let* ((force-update (if (member "--force-update" args) "true" "false")) (let* ((force-update (if (member "--force-update" args) "true" "false"))
;; set content type to: specified > last used > based on current buffer > default type ;; 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)))) (content-type (or (transient-arg-value "--content-type=" args) (khoj--buffer-name-to-content-type (buffer-name))))
(update-url (format "%s/api/update?t=%s&force=%s&client=emacs" khoj-server-url content-type force-update)) (type-query (if (equal content-type "all") "" (format "t=%s" content-type)))
(update-url (format "%s/api/update?%s&force=%s&client=emacs" khoj-server-url type-query force-update))
(url-request-method "GET")) (url-request-method "GET"))
(progn (progn
(setq khoj--content-type content-type) (setq khoj--content-type content-type)