From 296b145b859a295617d2355f1e30dc99ec8edc38 Mon Sep 17 00:00:00 2001 From: Laurence Chen Date: Wed, 31 Jul 2024 00:25:23 +0800 Subject: [PATCH] remove the unnecessary function in co.gaiwan.model.session namespace --- src/co/gaiwan/compass/html/sessions.clj | 9 ++++++--- src/co/gaiwan/compass/model/session.clj | 7 +------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/co/gaiwan/compass/html/sessions.clj b/src/co/gaiwan/compass/html/sessions.clj index 1e93c09..9efb9c7 100644 --- a/src/co/gaiwan/compass/html/sessions.clj +++ b/src/co/gaiwan/compass/html/sessions.clj @@ -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] @@ -184,6 +186,7 @@ "Leave"] [:button "Edit"]] #_[:p.host "Organized by " organized] + #_[:ol (map attendee participants)] #_[:p (pr-str user)] #_[:p (pr-str session)]]])) diff --git a/src/co/gaiwan/compass/model/session.clj b/src/co/gaiwan/compass/model/session.clj index d12f307..68aeeaa 100644 --- a/src/co/gaiwan/compass/model/session.clj +++ b/src/co/gaiwan/compass/model/session.clj @@ -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) @@ -10,6 +8,3 @@ (and (some? organized) (= (:db/id user) (:db/id organized)))) - -(defn attendee [id] - (db/entity id))