can unapprove, but there are bugs. UI doesnt refresh, filters are lost.

This commit is contained in:
Bryce Covert
2020-03-21 13:17:50 -07:00
parent bb59be6aea
commit add1dc6fcb
4 changed files with 146 additions and 86 deletions

View File

@@ -39,6 +39,16 @@
:start (:start args 0)
:end (+ (:start args 0) (count transactions))}]))
(defn unapprove-transactions [context args value]
(let [args (assoc args :id (:id context))
ids (:ids (d-transactions/raw-graphql-ids (update (<-graphql args) :approval-status
#(some->> %
name
snake->kebab
(keyword "transaction-approval-status")))))]
(d-transactions/unapprove ids)
(get-transaction-page context args value)))
(defn transaction-account->entity [{:keys [id account_id amount location]}]
(remove-nils #:transaction-account {:amount (Double/parseDouble amount)
:db/id id