From 930c02c95d43815748bf0e3b54b166299f89c5dc Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Sat, 27 Apr 2024 21:48:33 -0500 Subject: [PATCH] hopefully fixing form --- src/main.lisp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main.lisp b/src/main.lisp index f3a6093..2431fea 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -488,25 +488,25 @@ with the image attached" (registration (cdr (assoc "registration" data :test 'string=))) (health (cdr (assoc "health-form" data :test 'string=)))) (log:info data) + (when (not data) + (return)) ;; This is extremely necessary so that cors is right (setf (tbnl:header-out :access-control-expose-headers) "*") + (mail-camp-form data nil) (post-camp-data data) (if (string= health "bleh") (progn (uiop:println "Selected health later") (cond ((string= registration "now") (setf (hunchentoot:header-out :HX-Redirect) "https://secure.myvanco.com/L-Z772/campaign/C-13JPJ") (log:info (tbnl:headers-out*)) - (log:info "Sending them to pay now") - (mail-camp-form data nil)) + (log:info "Sending them to pay now")) ((string= registration "full") (setf (tbnl:header-out :HX-Redirect) "https://secure.myvanco.com/L-Z772/campaign/C-13JQE") (log:info (tbnl:headers-out*)) - (log:info "Sending them to pay full amount") - (mail-camp-form data nil)) + (log:info "Sending them to pay full amount")) ((string= registration "later") (let ((first-name (cdr (assoc "first-name" data :test 'string=))) (last-name (cdr (assoc "last-name" data :test 'string=)))) - (mail-camp-form data nil) (log:info "Sending the camp thank you snippet") (with-html-string (:div @@ -521,8 +521,7 @@ with the image attached" (when (string= health "bleh") (setf (tbnl:header-out :HX-Redirect) (format nil "/camp-health-form/?registration=~A" registration)) (log:info (tbnl:headers-out*)) - (log:info "Sending them to the health form for camp") - (mail-camp-form data nil))))) + (log:info "Sending them to the health form for camp"))))) (defun main () (start-server 4242)