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

@@ -65,6 +65,27 @@
:end]]]}
:on-success [::received]}}))
(re-frame/reg-event-fx
::unapprove-all
(fn [cofx [_ params]]
{:db (-> (:db cofx)
(assoc-in [:status :loading] true)
(assoc-in [::params] params))
:graphql {:token (-> cofx :db :user)
:query-obj
{:venia/operation {:operation/type :mutation
:operation/name "UnapproveTransactions"}
:venia/queries [{:query/data
[:unapprove-transactions
(assoc (::params (:db cofx)) :client-id (:id @(re-frame/subscribe [::subs/client])))
[[:transactions transaction-read]
:total
:start
:end]]}]}
:on-success [::received]}}))
(re-frame/reg-event-db
::received
(fn [db [_ data]]
@@ -161,7 +182,9 @@
[:div.is-pulled-right
[:div.buttons
[:button.button.is-outlined.is-primary {:on-click (dispatch-event [::manual/opening])}
"Manual Yodlee Import"]]]])
"Manual Yodlee Import"]
[:button.button.is-outlined.is-danger {:on-click (dispatch-event [::unapprove-all])}
"Unapprove all"]]]])
[table/table {:id :transactions
:params (re-frame/subscribe [::params])
:transaction-page (re-frame/subscribe [::transaction-page])