diff options
Diffstat (limited to 'src/endpoints.lisp')
-rw-r--r-- | src/endpoints.lisp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/endpoints.lisp b/src/endpoints.lisp index 5b65ff7..288f39e 100644 --- a/src/endpoints.lisp +++ b/src/endpoints.lisp @@ -133,12 +133,20 @@ functions in url parameters in endpoint definitions." (defendpoint* :get "/adventure-awaits" () () (with-session (player) (render (page-render-mode) - (make-instance 'new-adventure)))) + (make-instance 'adventure-awaits + :possible-seers (remove player (all-players)))))) (defendpoint* :post "/adventure-awaits" () () (with-session (creator) - (with-checked-plist ((title :title 'a-short-string)) (lzb:request-body) - (let ((adventure - (create-adventure creator title))) - (redirect-to (urlpath adventure)))))) + (with-plist ((title :title) (description :description)) (lzb:request-body) + (let ((possible-seers + (loop :for (key val) :on (lzb:request-body) :by #'cddr + :when (string-equal key "POSSIBLE-SEER") + :collect (object-with-uid val)))) + (redirect-to + (urlpath + (create-adventure creator title + :description description + :seers possible-seers))))))) + |