tells you about potential matches.
This commit is contained in:
@@ -6,6 +6,32 @@
|
||||
[auto-ap.views.utils :refer [date->str dispatch-event nf]]
|
||||
[goog.string :as gstring]
|
||||
[re-frame.core :as re-frame]))
|
||||
(re-frame/reg-event-fx
|
||||
::editing-matches-found
|
||||
(fn [{:keys [db]} [_ which payment-matches]]
|
||||
(println "FOUND" payment-matches)
|
||||
|
||||
{:dispatch
|
||||
[::edit/editing which (:potential-payment-matches payment-matches)]}))
|
||||
|
||||
(re-frame/reg-event-fx
|
||||
::editing-matches-failed
|
||||
(fn [{:keys [db]} [_ which payment-matches]]
|
||||
(println "FAILED" payment-matches)
|
||||
|
||||
{:dispatch
|
||||
[::edit/editing which payment-matches]}))
|
||||
|
||||
(re-frame/reg-event-fx
|
||||
::intend-to-edit
|
||||
(fn [{:keys [db]} [_ which]]
|
||||
{:graphql
|
||||
{:token (-> db :user)
|
||||
:query-obj {:venia/queries [{:query/data [:potential-payment-matches
|
||||
{:transaction_id (:id which)}
|
||||
[:id :memo [:vendor [:name]]]]}]}
|
||||
:on-success [::editing-matches-found which]
|
||||
:on-error [::editing-matches-failed which]}} ))
|
||||
|
||||
(defn table [{:keys [id transaction-page status on-params-change vendors params check-boxes checked on-check-changed expense-event]}]
|
||||
(let [opc (fn [p]
|
||||
@@ -96,7 +122,7 @@
|
||||
[:td status]
|
||||
[:td (:name bank-account )]
|
||||
[:td
|
||||
[:a.button {:on-click (dispatch-event [::edit/editing i])} [:span [:span.icon [:i.fa.fa-pencil]]]]
|
||||
[:a.button {:on-click (dispatch-event [::intend-to-edit i])} [:span [:span.icon [:i.fa.fa-pencil]]]]
|
||||
(when payment
|
||||
[:a.tag {:href (:s3-url payment) :target "_new"}
|
||||
#_[:i.fa.fa-money-check]
|
||||
|
||||
Reference in New Issue
Block a user