added support
This commit is contained in:
@@ -86,6 +86,21 @@
|
||||
(assoc-in db (concat [:admin :vendor] path)
|
||||
value)))
|
||||
|
||||
(re-frame/reg-event-db
|
||||
::add-relationship
|
||||
(fn [db [_ ]]
|
||||
(-> db
|
||||
(update-in [:admin :vendor :relationships] #(conj (or % [])
|
||||
{:account-number (get-in db [:admin :vendor :new-relationship-account-number])
|
||||
:company-id (get-in db [:admin :vendor :new-relationship-company])}))
|
||||
(update-in [:admin :vendor] dissoc :new-relationship-account-number :new-relationship-company))))
|
||||
|
||||
(re-frame/reg-event-db
|
||||
::remove-relationship
|
||||
(fn [db [_ i]]
|
||||
(-> db
|
||||
(update-in [:admin :vendor :relationships] #(vec (concat (subvec % 0 i) (subvec % (min (count %) (inc i)))))))))
|
||||
|
||||
(re-frame/reg-event-fx
|
||||
::mounted
|
||||
(fn [{:keys [db]} _]
|
||||
|
||||
Reference in New Issue
Block a user