Added with-query-args' as the equivalent of with-form-data' for
query url requests. This is probably a stop-gap measure, until a more general context processing framework (including session and validation data) has been designed and implemented.
This commit is contained in:
@ -85,6 +85,19 @@
|
|||||||
(let ,bindings
|
(let ,bindings
|
||||||
,@body)))))
|
,@body)))))
|
||||||
|
|
||||||
|
(defmacro with-query-args (vars request &body body)
|
||||||
|
(loop with data-sym = (gensym)
|
||||||
|
for var in vars
|
||||||
|
collect
|
||||||
|
`(,var (cdr (assoc (symbol-name ',var) ,data-sym
|
||||||
|
:test #'string-equal)))
|
||||||
|
into bindings
|
||||||
|
finally
|
||||||
|
(return
|
||||||
|
`(let ((,data-sym (url-query-arguments (request-url ,request))))
|
||||||
|
(let ,bindings
|
||||||
|
,@body)))))
|
||||||
|
|
||||||
;;; Some further utility resources
|
;;; Some further utility resources
|
||||||
|
|
||||||
;;; Redirection
|
;;; Redirection
|
||||||
|
|||||||
@ -202,6 +202,7 @@
|
|||||||
#:dynamic-form-resource-processor
|
#:dynamic-form-resource-processor
|
||||||
#:parse-form-data
|
#:parse-form-data
|
||||||
#:with-form-data
|
#:with-form-data
|
||||||
|
#:with-query-args
|
||||||
#:redirector-resource
|
#:redirector-resource
|
||||||
#:redirector-resource-code
|
#:redirector-resource-code
|
||||||
#:redirector-resource-destination
|
#:redirector-resource-destination
|
||||||
|
|||||||
Reference in New Issue
Block a user