Browse Source

refactor build search URL feat. in search package (site-settings).

I've left the old code as a comment just in case I need to reverse course. The
new way the function gets the (Meilisearch )search URL is to get it from the
database (site-settings table). This should make it easier to pass the URL
around between the back-end and front-end.
stable
Craig Oates 2 years ago
parent
commit
55f12b3f5b
  1. 15
      src/search.lisp

15
src/search.lisp

@ -4,7 +4,9 @@
#:archive #:archive
#:cl-json #:cl-json
#:local-time #:local-time
#:utils) #:utils
#:site-settings
#:nera)
(:import-from #:dexador (:import-from #:dexador
#:request) #:request)
(:export #:build-keywords-string (:export #:build-keywords-string
@ -52,10 +54,13 @@ The function will check to see which environment the current instance of this
site is running in and use the beta or prod. URL's to connect to meilisearch. site is running in and use the beta or prod. URL's to connect to meilisearch.
`PATH' is the relative path which this function will concatenate onto the end of `PATH' is the relative path which this function will concatenate onto the end of
the base URL." the base URL."
(if (ritherdon-archive.config:developmentp)
(concatenate 'string "http://localhost:7700" path) ;; (if (ritherdon-archive.config:developmentp)
;; (utils:build-url-root) ;; (concatenate 'string "http://localhost:7700" path)
(concatenate 'string "https://www.nera.com" path))) ;; ;; (utils:build-url-root)
;; (concatenate 'string "https://www.nera.com" path))
(format nil "~a~a" (site-settings::search-url-of (nera:get-site-settings)) path))
(defun delete-entry (id) (defun delete-entry (id)
"Deletes and entry from the meilisearch database based on its `ID'. "Deletes and entry from the meilisearch database based on its `ID'.

Loading…
Cancel
Save