allows manually matching rules.
This commit is contained in:
@@ -10,9 +10,9 @@
|
||||
[re-frame.core :as re-frame]))
|
||||
(re-frame/reg-event-fx
|
||||
::editing-matches-found
|
||||
(fn [{:keys [db]} [_ which payment-matches]]
|
||||
(fn [{:keys [db]} [_ which matches]]
|
||||
{:dispatch
|
||||
[::edit/editing which (:potential-payment-matches payment-matches)]}))
|
||||
[::edit/editing which (:potential-payment-matches matches) (:potential-transaction-rule-matches matches)]}))
|
||||
|
||||
(re-frame/reg-event-fx
|
||||
::editing-matches-failed
|
||||
@@ -25,9 +25,13 @@
|
||||
(fn [{:keys [db]} [_ which]]
|
||||
{:graphql
|
||||
{:token (-> db :user)
|
||||
:query-obj {:venia/queries [{:query/data [:potential-payment-matches
|
||||
{:transaction_id (:id which)}
|
||||
[:id :memo :check-number [:vendor [:name]]]]}]}
|
||||
:query-obj {:venia/queries (into [{:query/data [:potential-payment-matches
|
||||
{:transaction_id (:id which)}
|
||||
[:id :memo :check-number [:vendor [:name]]]]}]
|
||||
(when @(re-frame/subscribe [::subs/is-admin?])
|
||||
[{:query/data [:potential-transaction-rule-matches
|
||||
{:transaction_id (:id which)}
|
||||
[:id :note]]}]))}
|
||||
:on-success [::editing-matches-found which]
|
||||
:on-error [::editing-matches-failed which]}} ))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user