From bdbde0e862de5657fd1e147a527036d43ce105e9 Mon Sep 17 00:00:00 2001 From: Laurence Chen Date: Tue, 23 Jul 2024 19:26:12 +0800 Subject: [PATCH] little fix of participating backend --- repl-sessions/db.clj | 6 +++--- src/co/gaiwan/compass/routes/sessions.clj | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/repl-sessions/db.clj b/repl-sessions/db.clj index 10d8854..c9279f9 100644 --- a/repl-sessions/db.clj +++ b/repl-sessions/db.clj @@ -16,7 +16,7 @@ ;; Test transact participants -(def req {:identity "ccc" +(def req {:identity {:user/email "ddd"} :path-params {:id "17592186045455"}}) (def session-eid 17592186045455) @@ -26,7 +26,7 @@ (def session (db/entity (parse-long (get-in req [:path-params :id])))) -(let [user-id-str (:identity req) +(let [user-id-str (:user/email (:identity req)) session-eid (parse-long (get-in req [:path-params :id])) ;; session (db/entity session-eid) capacity (:session/capacity session) @@ -40,7 +40,7 @@ (prn :curr-ps curr-participants) (prn :check (< signup capacity)) (prn :debug-tx [[:db/cas session-eid :session/signup signup new-signup] - [:db/add session-eid :session/participants user-id-str]]) + [:db/add session-eid :session/participants user-id-str]]) (if (< signup capacity) @(db/transact [[:db/cas session-eid :session/signup signup new-signup] [:db/add session-eid :session/participants user-id-str]]) diff --git a/src/co/gaiwan/compass/routes/sessions.clj b/src/co/gaiwan/compass/routes/sessions.clj index 5ca98fb..f6b84c6 100644 --- a/src/co/gaiwan/compass/routes/sessions.clj +++ b/src/co/gaiwan/compass/routes/sessions.clj @@ -70,7 +70,7 @@ ;; similar, depending on what makes sense with htmx) (util/redirect (oauth/flow-init-url {:redirect-url (str "/sessions/" (get-in req [:path-params :id]) "/participate")})) (do - (let [user-id-str (:identity req) + (let [user-id-str (:user/email (:identity req)) session-eid (parse-long (get-in req [:path-params :id])) session (db/entity session-eid) capacity (:session/capacity session)