summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--endpoints.lisp11
-rw-r--r--transactions.lisp4
2 files changed, 8 insertions, 7 deletions
diff --git a/endpoints.lisp b/endpoints.lisp
index 4bbc4f7..f734e37 100644
--- a/endpoints.lisp
+++ b/endpoints.lisp
@@ -74,13 +74,14 @@ I.e. It should be called within the scope of a request handler."
(godess-shrine))
-(defendpoint* :post "/godess-shrine" () ()
- (with-plist ((name :name)) (lzb:request-body)
- (birth-from-the-goddess-loins name)
- (redirect-to "/tavern-door")))
-
;;; SESSION ENDPOINTS
(defendpoint* :get "/tavern" () ()
(with-session (player)
(tavern player)))
+
+(defendpoint* :post "/godess-shrine" () ()
+ (with-session (player)
+ (with-plist ((name :name)) (lzb:request-body)
+ (birth-from-the-goddess-loins player name)
+ (redirect-to "/tavern"))))
diff --git a/transactions.lisp b/transactions.lisp
index 2c65434..35e817c 100644
--- a/transactions.lisp
+++ b/transactions.lisp
@@ -2,9 +2,9 @@
(in-package :dnd)
-(defun birth-from-the-goddess-loins (name)
+(defun birth-from-the-goddess-loins (player name)
(db:with-transaction ()
- (make-instance 'hero :name name)))
+ (make-instance 'hero :name name :player player)))
(defun new-sesh (player)
(db:with-transaction () (make-instance 'session :player player)))