summaryrefslogtreecommitdiff
path: root/src/endpoints.lisp
diff options
context:
space:
mode:
authorGrant Shoshin Shangreaux <shoshin@cicadas.surf>2023-04-01 09:59:16 -0500
committerGrant Shoshin Shangreaux <shoshin@cicadas.surf>2023-04-01 09:59:16 -0500
commit56a584ab1b13ff9510dd5145a778000169901a76 (patch)
tree87bc66e865da64f641152b64539bf6bbfc900218 /src/endpoints.lisp
parent20e0bb168032e2e2aa95b08e2dbc9bedced62df3 (diff)
Add: aventure seers form
Diffstat (limited to 'src/endpoints.lisp')
-rw-r--r--src/endpoints.lisp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/endpoints.lisp b/src/endpoints.lisp
index acc62c9..a29dc3f 100644
--- a/src/endpoints.lisp
+++ b/src/endpoints.lisp
@@ -75,7 +75,7 @@ functions in url parameters in endpoint definitions."
`(defun ,function-name (id)
(let ((object (object-with-uid (string-upcase id))))
(unless (typep object ',class)
- (lzb:http-err 404))
+ (lzb:http-err 404 (format nil "No ~a with id = ~a" ',class id)))
object))))
(define-id-plucker adventure)
@@ -201,6 +201,14 @@ functions in url parameters in endpoint definitions."
:player player
:adventure adventure)))) ;; for now, render raw adventure.
+(defendpoint* :post "/adventure/:adventure an-adventure-with-id:/:title:" () ()
+ (with-session (player)
+ (with-plist ((seer :seer)) (lzb:request-body)
+ (when (player-with-nick seer)
+ (add-adventure-seer (player-with-nick seer) adventure))
+ (redirect-to (urlpath adventure)))))
+
+
(defendpoint* :get "/hero/:hero a-hero-with-id:/:name:" () ()
(with-session (player)
(render (page-render-mode)