editing clients has started.

This commit is contained in:
Bryce Covert
2019-01-19 09:52:06 -08:00
parent 9e1999725c
commit de5ebe8108
7 changed files with 54 additions and 28 deletions

View File

@@ -23,17 +23,18 @@
::save
(fn [{:keys [db]} _]
(let [edited-client (-> (get-in db [:admin :client])
(dissoc :location)
(dissoc :new-account))]
(dissoc :location))]
{:db (assoc-in db [:admin :client :saving?] true)
:http {:method :put
:token (:user db)
:body (pr-str edited-client)
:headers {"Content-Type" "application/edn"}
:uri (str "/api/clients/" (:id edited-client))
:on-success [::save-complete]
:on-error [::save-error]}})))
:graphql
{:token (-> db :user)
:query-obj {:venia/operation {:operation/type :mutation
:operation/name "EditClient"}
:venia/queries [{:query/data [:edit-client
{:edit-client edited-client}
[:id :name]
]}]}
:on-success [::save-complete]
:on-error [::save-error]}})))
(re-frame/reg-event-fx
::save-complete
@@ -151,6 +152,7 @@
^{:key location} [:li location ])]]]
[:h2.subtitle "Address"]
[address-field {:field [:address]
:event ::change
:subscription editing-client}]