Skip to content

Commit

Permalink
remove the unnecessary function in co.gaiwan.model.session namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
humorless committed Jul 30, 2024
1 parent d3d73ad commit 296b145
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
9 changes: 6 additions & 3 deletions src/co/gaiwan/compass/html/sessions.clj
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,11 @@
#_[:p.host "Organized by " organized]]]))

(o/defstyled attendee :li
([{:db/keys [id]}]
(let [{:user/keys [name]} (session/attendee id)]
name)))
([participant]
;; (prn "debug datatype " (type participant))
;; participant is of `Datomic.query.EntityMap` type
;; So, we can access its attribute directly
(:user/handle participant)))

(o/defstyled session-detail :div
[capacity-gauge :w-100px]
Expand Down Expand Up @@ -184,6 +186,7 @@
"Leave"]
[:button "Edit"]]
#_[:p.host "Organized by " organized]
#_[:ol (map attendee participants)]
#_[:p (pr-str user)]
#_[:p (pr-str session)]]]))

Expand Down
7 changes: 1 addition & 6 deletions src/co/gaiwan/compass/model/session.clj
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
(ns co.gaiwan.compass.model.session
(:require
[co.gaiwan.compass.db :as db]))
(ns co.gaiwan.compass.model.session)

(defn participating? [session user]
(some (comp #{(:db/id user)} :db/id)
Expand All @@ -10,6 +8,3 @@
(and
(some? organized)
(= (:db/id user) (:db/id organized))))

(defn attendee [id]
(db/entity id))

0 comments on commit 296b145

Please sign in to comment.