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
|
||||
,@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
|
||||
|
||||
;;; Redirection
|
||||
|
||||
Reference in New Issue
Block a user