                             (assoc :id (:user/id user))
                             (assoc :sub (:user/subject user))))))}))
 
+(defn- fetch-congregation2 [conn state user-id congregation]
+  (let [cong-id (:congregation/id congregation)]
+    {:id (:congregation/id congregation)
+     :name (:congregation/name congregation)
+     :permissions (->> (permissions/list-permissions state user-id [cong-id])
+                       (map (fn [permission]
+                              [permission true]))
+                       (into {}))
+     :territories (vec (vals (get-in state [::territory/territories cong-id])))
+     :congregation-boundaries (vec (vals (get-in state [::congregation-boundary/congregation-boundaries cong-id])))
+     :subregions (vec (vals (get-in state [::subregion/subregions cong-id])))
+     :card-minimap-viewports (vec (vals (get-in state [::card-minimap-viewport/card-minimap-viewports cong-id])))
+     :users (->> (user/get-users conn {:ids (congregation/get-users state cong-id)})
+                 (map (fn [user]
+                        (-> (:user/attributes user)
+                            (assoc :id (:user/id user))
+                            (assoc :sub (:user/subject user))))))}))
+
 (def ^:private validate-congregation (s/validator Congregation))
 
 (defn get-congregation [request]

  (db/with-db [conn {:read-only? true}]
    (->> (user/get-users conn)
         (filter #(= "" (:name (:user/attributes %)))))))

            [ring.util.response :as response]
            [schema.core :as s]
            [territory-bro.authentication :as auth]
            [territory-bro.card-minimap-viewport :as card-minimap-viewport]
            [territory-bro.config :as config]
            [territory-bro.congregation :as congregation]
            [territory-bro.congregation-boundary :as congregation-boundary]
            [territory-bro.db :as db]
            [territory-bro.dispatcher :as dispatcher]
            [territory-bro.gis-db :as gis-db]
