From 55f12b3f5bb9555d718c5891e96a2d7ef02e41a1 Mon Sep 17 00:00:00 2001 From: Craig Oates Date: Thu, 27 Oct 2022 23:54:09 +0100 Subject: [PATCH] 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. --- src/search.lisp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/search.lisp b/src/search.lisp index 8d5522b..47046eb 100644 --- a/src/search.lisp +++ b/src/search.lisp @@ -4,7 +4,9 @@ #:archive #:cl-json #:local-time - #:utils) + #:utils + #:site-settings + #:nera) (:import-from #:dexador #:request) (: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. `PATH' is the relative path which this function will concatenate onto the end of the base URL." - (if (ritherdon-archive.config:developmentp) - (concatenate 'string "http://localhost:7700" path) - ;; (utils:build-url-root) - (concatenate 'string "https://www.nera.com" path))) + + ;; (if (ritherdon-archive.config:developmentp) + ;; (concatenate 'string "http://localhost:7700" 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) "Deletes and entry from the meilisearch database based on its `ID'.