bank accounts can now have locations.

This commit is contained in:
Bryce Covert
2019-06-04 07:08:10 -07:00
parent cf2319b681
commit 7ac17c9cbc
13 changed files with 90 additions and 18 deletions

View File

@@ -74,6 +74,16 @@
(fn [db [_ client]]
(:locations (get (:clients db) (or client (:client db))))))
(re-frame/reg-sub
::locations-for-client-or-bank-account
(fn [db [_ client-id bank-account-id]]
(let [client (get (:clients db) (or client (:client db)))
client-locations (:locations client)
bank-account-locations (-> (by :id (:bank-accounts client))
(get bank-account-id)
:locations)]
(or bank-account-locations client-locations))))
(re-frame/reg-sub
::clients-by-id
(fn [db]