        (map (comp db->user first))
        set))
 
-(defn- db->thread [thread]
+(defn- db->thread
+  [thread]
   {:id (thread :thread/id)
    :messages (map (fn [msg]
                     {:id (msg :message/id)

      ]))


(defn uuid []
  (d/squuid))

(defn- db->user [e]
  {:id (:user/id e)
   :email (:user/email e)
   :avatar (:user/avatar e)})

(defn- db->message [e]
  {:id (:message/id e)
   :content (:message/content e)
   :user-id (:user/id (:message/user e))

       (d/db *conn*)
       user-id))

(defn user-hide-thread!
  [user-id thread-id]
  (d/transact
    *conn*
    [[:db/retract [:user/id user-id] :user/open-thread [:thread/id thread-id]]]))

(defn- db->tag
  [e]
  {:id (:tag/id e)
   :name (:tag/name e)
   :group-id (get-in e [:tag/group :group/id])
