Plaster
New
List
Login
common-lisp
default
anonymous
2024.01.16 14:51:41
@export (defmacro with-json-params ((json-params &rest json-keys) &body body) ; (declare (ignorable json-params)) `(let* ((,json-params (KLI-KODESH.UTILS.GENERAL-UTILS:GET-PARAMS)) ,@(loop for json-key in json-keys collect `(,json-key (get-request-json-value ,(cl-case-to-camel-case json-key))))) ,@body)) ; TODO need to test @export (defmacro defjson-route-with-preflight-params (url-details json-params-name route-params &body body) (declare (ignorable json-params-name)) `(defpost-route-with-preflight ,url-details NIL ; (declare (ignorable ,json-params-name)) (setf (getf (caveman2:response-headers caveman2:*response*) :content-type) "application/json") (with-json-params (,json-params-name ,@route-params) ,@body)))
Raw
Annotate
Repaste
Edit