Skip to content
Snippets Groups Projects
Commit 4bb2298d authored by Cam Saül's avatar Cam Saül
Browse files

Hydrate :collection for GET /api/card

parent c8074c3e
Branches
Tags
No related merge requests found
......@@ -129,7 +129,7 @@
;; TODO - do we need to hydrate the cards' collections as well?
(defn- cards-for-filter-option [filter-option model-id label collection]
(let [cards (-> ((filter-option->fn (or filter-option :all)) model-id)
(hydrate :creator)
(hydrate :creator :collection)
hydrate-labels
hydrate-favorites)]
;; Since labels and collections are hydrated in Clojure-land we need to wait until this point to apply label/collection filtering if applicable
......
......@@ -174,15 +174,13 @@
(defn- pre-insert [permissions]
(u/prog1 permissions
(assert-valid permissions)
;; NOCOMMIT
(println (u/format-color 'green "Granting permissions for group %d: %s" (:group_id permissions) (:object permissions)))))
(log/debug (u/format-color 'green "Granting permissions for group %d: %s" (:group_id permissions) (:object permissions)))))
(defn- pre-update [_]
(throw (Exception. "You cannot update a permissions entry! Delete it and create a new one.")))
(defn- pre-cascade-delete [permissions]
;; NOCOMMIT
(println (u/format-color 'red "Revoking permissions for group %d: %s" (:group_id permissions) (:object permissions)))
(log/debug (u/format-color 'red "Revoking permissions for group %d: %s" (:group_id permissions) (:object permissions)))
(assert-not-admin-group permissions))
......@@ -468,10 +466,9 @@
(defn log-permissions-changes
"Log changes to the permissions graph."
[old new]
;; NOCOMMIT
(printf "Changing permissions: 🔏\nFROM:\n%s\nTO:\n%s\n"
(u/pprint-to-str 'magenta old)
(u/pprint-to-str 'blue new)))
(log/debug (format "Changing permissions: 🔏\nFROM:\n%s\nTO:\n%s\n"
(u/pprint-to-str 'magenta old)
(u/pprint-to-str 'blue new))))
(s/defn ^:always-validate update-graph!
"Update the permissions graph, making any changes neccesary to make it match NEW-GRAPH.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment