more standardization

This commit is contained in:
Bryce Covert
2020-08-17 10:58:05 -07:00
parent 85a110d878
commit 8036d34a4e
12 changed files with 252 additions and 255 deletions

View File

@@ -20,7 +20,8 @@
[auto-ap.views.pages.check :as check]
[auto-ap.subs :as subs]
[auto-ap.status :as status]
[vimsical.re-frame.fx.track :as track]))
[vimsical.re-frame.fx.track :as track]
[auto-ap.effects.forward :as forward]))
@@ -72,7 +73,7 @@
(fn [{:keys [db]} _]
{:db (dissoc db ::last-params ::table/table-params ::side-bar/filters ::side-bar/settled-filters ::payment-page)
::track/dispose {:id ::params}
:forward-events {:unregister ::page}}))
::forward/dispose {:id ::page}}))
(re-frame/reg-event-fx
::mounted
@@ -80,14 +81,15 @@
{::track/register {:id ::params
:subscription [::params]
:event-fn (fn [params] [::params-change params])}
:forward-events {:register ::page
:events #{::table/payment-voided}
:dispatch-to [::payment-voided]}}))
::forward/register {:id ::page
:events #{::table/payment-voided}
:event-fn (fn [[_ result]]
[::payment-voided result])}}))
(re-frame/reg-event-db
::payment-voided
[(re-frame/path [::payment-page :payments])]
(fn [db [_ [_ {:keys [void-payment]}]]]
(fn [db [_ {:keys [void-payment]}]]
(mapv (fn [c]
(if (= (:id c) (:id void-payment))
(assoc void-payment :class "live-removed")