From ee282adf8b9cb3db007383cfc1d771f822f8c0f9 Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Wed, 12 Aug 2020 10:08:14 -0700 Subject: [PATCH] all functions work --- src/cljs/auto_ap/views/pages/unpaid_invoices.cljs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/cljs/auto_ap/views/pages/unpaid_invoices.cljs b/src/cljs/auto_ap/views/pages/unpaid_invoices.cljs index d346d160..2b17b5bc 100644 --- a/src/cljs/auto_ap/views/pages/unpaid_invoices.cljs +++ b/src/cljs/auto_ap/views/pages/unpaid_invoices.cljs @@ -157,23 +157,19 @@ (re-frame/reg-event-db ::advanced-print-checks (fn [db _] - (let [{:keys [checked invoices]} (get-in db [::invoice-page])] + (let [invoices @(re-frame/subscribe [::checked-invoices])] (-> db (forms/stop-form ::form/form) (update-in [::invoice-page :print-checks-shown?] #(not %) ) (assoc-in [::advanced-print-checks] {:shown? true :bank-account-id (:id (first @(re-frame/subscribe [::subs/bank-accounts]))) - :invoices (->> checked - vals - (map #(assoc % :amount (:outstanding-balance %))))} ))))) + :invoices (map #(assoc % :amount (:outstanding-balance %)) invoices )} ))))) (re-frame/reg-event-fx ::handwrite-checks (fn [{:keys [db]} _] - (let [{:keys [checked invoices]} (get-in db [::invoice-page]) - invoices (->> checked - vals - (map #(assoc % :amount (:outstanding-balance %))))] + (let [invoices @(re-frame/subscribe [::checked-invoices]) + invoices (map #(assoc % :amount (:outstanding-balance %)) invoices)] {:dispatch [::events/modal-status ::handwrite-checks {:visible? true}] :db (-> db