Made it so customers can create vendors.

This commit is contained in:
BC
2018-06-21 23:27:35 -07:00
parent fc411909aa
commit e4e2525ce9
6 changed files with 243 additions and 26 deletions

View File

@@ -7,6 +7,7 @@
[auto-ap.events.admin.vendors :as events]
[auto-ap.entities.vendors :as entity]
[auto-ap.views.components.address :refer [address-field]]
[auto-ap.views.components.vendor-dialog :refer [vendor-dialog]]
[auto-ap.views.components.modal :refer [modal]]
[clojure.spec.alpha :as s]
[auto-ap.views.utils :refer [login-url dispatch-value-change dispatch-event bind-field horizontal-field]]
@@ -55,7 +56,7 @@
(defn edit-dialog []
#_(defn edit-dialog []
(let [editing-vendor (:vendor @(re-frame/subscribe [::subs/admin]))
companies-by-id @(re-frame/subscribe [::subs/companies-by-id])]
@@ -263,7 +264,9 @@
[:div.is-pulled-right
[:a.button.is-primary.is-large {:on-click (dispatch-event [::events/new])} "New vendor"]]
(when editing-vendor
[edit-dialog])])])
[vendor-dialog {:vendor editing-vendor
:save-event [::events/save]
:change-event ::events/change
:id ::admin-vendor}]])])
{:component-did-mount (fn []
(re-frame/dispatch [::events/mounted]))})])