diff options
Diffstat (limited to 'src/endpoints.lisp')
-rw-r--r-- | src/endpoints.lisp | 10 |
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) |