editing clients has started.
This commit is contained in:
@@ -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}]
|
||||
|
||||
Reference in New Issue
Block a user