One modal to rule them all.

This commit is contained in:
Bryce Covert
2020-09-05 08:18:29 -07:00
parent 4847917e6b
commit 74e34e3592
10 changed files with 106 additions and 161 deletions

View File

@@ -115,28 +115,6 @@
(assoc-in db (into location field) value)
(update-in db (into location (butlast field)) dissoc (last field)))))
(re-frame/reg-event-db
::modal-status
(fn [db [_ id state]]
(println "changing modal status" id "to")
(-> db
(update-in [:modal-state id] #(merge % state))
#_(dissoc :auto-ap.forms/forms)
)))
(re-frame/reg-event-db
::modal-failed
(fn [db [_ id message]]
(-> db
(assoc-in [:modal-state id :saving?] false)
(assoc-in [:modal-state id :error-message] message))))
(re-frame/reg-event-db
::modal-completed
(fn [db [_ id state]]
(-> db
(update-in [:modal-state] #(dissoc % id))
(update :auto-ap.forms/forms dissoc id))))
(re-frame/reg-event-fx
::set-active-page