diff options
| author | ckonstanski <kostcarl@isu.edu> | 2026-09-06 22:04:28 -0600 |
|---|---|---|
| committer | ckonstanski <kostcarl@isu.edu> | 2026-09-06 22:04:28 -0600 |
| commit | e774d11af63764a7457d842ecd74b30a183fa71e (patch) | |
| tree | 7e0237cf69236ca14a7ad954dc083355b8f30e4a /lisp/service/contact-us-service.lisp | |
| parent | beb0bed0b615ebcfdc0415cc9d7aff656964c427 (diff) | |
Diffstat (limited to 'lisp/service/contact-us-service.lisp')
| -rw-r--r-- | lisp/service/contact-us-service.lisp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/lisp/service/contact-us-service.lisp b/lisp/service/contact-us-service.lisp index 4e2aada..959b746 100644 --- a/lisp/service/contact-us-service.lisp +++ b/lisp/service/contact-us-service.lisp @@ -7,6 +7,16 @@ () (:documentation "")) +(defclass contact-us/view-service (contact-us-service) + ((content :initarg :content + :initform nil + :accessor content) + (form :initarg :form + :initform nil + :accessor form) + (location-p :initform nil)) + (:documentation "")) + (defun contact-us-form () (make-form "contact-us-form" nil @@ -22,27 +32,13 @@ (with-noauth (instance contact-us-service) t)) -(defclass contact-us/view-service (contact-us-service) - ((content :initarg :content - :initform nil - :accessor content) - (form :initarg :form - :initform nil - :accessor form) - (location-p :initform nil)) - (:documentation "")) - (defun contact-us-view-json () (with-noauth (instance contact-us/view-service) (setf (form instance) (contact-us-form)))) -(defclass contact-us/email-service (contact-us/view-service) - () - (:documentation "")) - (defun contact-us-email-json (first_name last_name email phone comments) (declare (special first_name last_name email phone comments)) - (with-noauth (instance contact-us/email-service) + (with-noauth (instance contact-us/email-servicea) (with-bogenherr-database (let ((contact-pkg (make-instance 'contact-pkg)) (contact-us-post (make-instance 'contact-us-post))) @@ -78,7 +74,11 @@ :reply-to (mail-postmaster *webapp*) :ssl (mail-ssl *webapp*) :authentication (mail-authentication *webapp*)) - (setf (session-value :message) "Form submitted successfully.")) + (setf (message instance) "Form submitted successfully.")) (error (e) (declare (ignore e)) - (setf (session-value :errormsg) "Error submitting form."))))))) + (setf (errormsg instance) "Error submitting form."))))))) + +(define-endpoint ("/contact-us" :method :get) () contact-us-json) +(define-endpoint ("/contact-us/view" :method :get) () contact-us-view-json) +(define-endpoint ("/contact-us/email" :method :post) (&post (first_name :parameter-type 'string) (last_name :parameter-type 'string) (email :parameter-type 'string) (phone :parameter-type 'string) (comments :parameter-type 'string)) contact-us-email-json first_name last_name email phone comments) |
