moving to using htmx and the lisp server on camp forms

This commit is contained in:
Chris Cochrun 2024-04-24 08:22:53 -05:00
parent 6034b7764a
commit 22e5161b4c
5 changed files with 298 additions and 7 deletions

View file

@ -381,6 +381,26 @@ with the image attached"
(:th (car row))
(:td (cdr row))))))))))))
(hunchentoot:define-easy-handler (respond :uri "/camp-api") ()
(uiop:println "hey")
(setf (hunchentoot:content-type*) "plain/text")
(let* ((request-type (hunchentoot:request-method hunchentoot:*request*))
(data (hunchentoot:post-parameters* hunchentoot:*request*)))
(uiop:println (assoc "registration" data :test 'string=))
(uiop:println (tbnl:headers-out*))
(if (string= (cdr (assoc "registration" data :test 'string=)) "now")
(progn (uiop:println "did it")
(setf (hunchentoot:header-out "HX-Redirect") "https://secure.myvanco.com/L-Z772/campaign/C-13JPJ")
(uiop:println (tbnl:headers-out*))
(uiop:println (hunchentoot:return-code*))
(with-html-string
(:div
(:p "Payment"))))
(progn
(with-html-string
(:div
(:p "Thank You")))))))
(defun define-post-form-handler (uri mail-function)
"Take a uri and a mailer function and define a handler in hunchentoot
for forms to POST to."