From 2b2b02c47455e90c90a833da4be7db32cab5a64d Mon Sep 17 00:00:00 2001 From: colin Date: Fri, 26 May 2023 08:55:49 -0700 Subject: Param parser for search terms --- fussy.lisp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'fussy.lisp') diff --git a/fussy.lisp b/fussy.lisp index 7416378..4f20643 100644 --- a/fussy.lisp +++ b/fussy.lisp @@ -567,12 +567,14 @@ h1 { (defun a-string (s) s) -(lzb:defendpoint* :get "/" ((page an-integer) (terms a-string)) () +(defun a-search-query (terms) + "Parses a space separated list for search terms and returns a list." + (when terms (str:split-omit-nulls #\space terms))) + +(lzb:defendpoint* :get "/" ((page an-integer) (terms a-search-query)) () "The landing page" (let* ((page (or page 0)) - (terms - (when terms (str:split-omit-nulls #\space terms))) (all-themes (if terms (search-themes terms :sort-by (complement #'package-version<=)) -- cgit v1.2.3