everything is audited.

This commit is contained in:
Bryce Covert
2020-09-04 19:53:39 -07:00
parent 3d0f079de2
commit 11f61464f5
15 changed files with 297 additions and 131 deletions

View File

@@ -789,13 +789,14 @@
(:sort args)))
(defn apply-sort-3 [args results]
(let [sort-bys (conj (:sort args)
{:sort-key "default" :asc true})
length (count sort-bys)
comparator (fn [xs ys]
(reduce
(fn [_ i]
(let [comparison (if (:asc (sort-bys i))
(let [comparison (if (:asc (nth sort-bys i))
(compare (nth xs i) (nth ys i))
(compare (nth ys i) (nth xs i)))]
@@ -819,9 +820,10 @@
(let [batch-id (.toString (java.util.UUID/randomUUID))]
(reduce
(fn [full-tx batch]
(let [batch (conj batch {:db/id "datomic.tx"
(let [batch (conj (vec batch) {:db/id "datomic.tx"
:audit/user (str (:user/role id) "-" (:user/name id))
:audit/batch batch-id})
_ (log/info "transacting batch " batch-id " " (count batch))
tx-result @(d/transact conn batch)]
(cond-> full-tx