(cloud) Saving things now update the search index

This commit is contained in:
2023-05-04 21:23:09 -07:00
parent 4e7e19da97
commit 14156e6ced
6 changed files with 71 additions and 38 deletions

View File

@@ -13,7 +13,8 @@
[clojure.core.cache :as cache]
[clojure.tools.logging :as log]
[datomic.api :as dc]
[digest :as di]))
[digest :as di]
[auto-ap.solr :as solr]))
(defn rough-match [client-id bank-account-id amount]
(if (and client-id bank-account-id amount)
@@ -317,11 +318,13 @@
:error :import-batch/error
:not-ready :import-batch/not-ready) inc))
(when (= :import action)
(audit-transact [[:upsert-transaction (transaction->txs transaction bank-account rule-applying-function)]
{:db/id import-id
:import-batch/entry (:db/id transaction)}]
(let [result (audit-transact [[:upsert-transaction (transaction->txs transaction bank-account rule-applying-function)]
{:db/id import-id
:import-batch/entry (:db/id transaction)}]
{:user/name user
:user/role ":admin"}))))
:user/role ":admin"})]
(doseq [n (:tempids result)]
(solr/touch-with-ledger n))))))
(get-stats [_]
@stats)