lots of improvements.
This commit is contained in:
@@ -25,6 +25,9 @@
|
||||
id (or (:db/id client) "new-client")
|
||||
_ (println id)
|
||||
_ (println edit_client)
|
||||
_ (when client
|
||||
@(d/transact (d/connect uri)
|
||||
(mapv (fn [lm] [:db/retractEntity (:db/id lm)]) (:client/location-matches client))))
|
||||
transactions [(remove-nils {:db/id id
|
||||
:client/code (if (str/blank? (:client/code client))
|
||||
(:code edit_client)
|
||||
@@ -64,7 +67,16 @@
|
||||
})]
|
||||
result @(d/transact (d/connect uri) transactions)]
|
||||
(println result "ID" id)
|
||||
(-> result :tempids (get id) (or id) d-clients/get-by-id ->graphql)))
|
||||
(-> result :tempids (get id) (or id) d-clients/get-by-id
|
||||
(update :client/location-matches
|
||||
(fn [lms]
|
||||
(mapcat (fn [lm]
|
||||
(map (fn [m]
|
||||
{:location-match/match m
|
||||
:location-match/location (:location-match/location lm)})
|
||||
(:location-match/matches lm)))
|
||||
lms)))
|
||||
->graphql)))
|
||||
|
||||
|
||||
(defn get-client [context args value]
|
||||
|
||||
Reference in New Issue
Block a user