Skip to content

Commit

Permalink
little fix of participating backend
Browse files Browse the repository at this point in the history
  • Loading branch information
humorless committed Jul 23, 2024
1 parent 2b5a7fa commit bdbde0e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions repl-sessions/db.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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]])
Expand Down
2 changes: 1 addition & 1 deletion src/co/gaiwan/compass/routes/sessions.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bdbde0e

Please sign in to comment.