(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

@@ -22,7 +22,8 @@
[clj-time.core :as time]
[clojure.tools.logging :as log]
[com.brunobonacci.mulog :as mu]
[datomic.api :as dc]))
[datomic.api :as dc]
[auto-ap.solr :as solr]))
(defn ->graphql [invoice user ]
(if (= "admin" (:user/role user))
@@ -176,6 +177,7 @@
(assert-invoice-amounts-add-up in)
(let [transaction-result (audit-transact [(add-invoice-transaction in)] (:id context))]
(solr/touch-with-ledger (get-in transaction-result [:tempids "invoice"]))
(-> (d-invoices/get-by-id (get-in transaction-result [:tempids "invoice"]))
(->graphql (:id context)))))
@@ -231,6 +233,7 @@
:invoice/scheduled-payment (coerce/to-date scheduled_payment)}]
(audit-transact [[:upsert-invoice updated-invoice]]
(:id context))
(solr/touch-with-ledger id)
(-> (d-invoices/get-by-id id)
(->graphql (:id context)))))