account new override

This commit is contained in:
2023-10-22 21:47:36 -07:00
parent 76760b7bcf
commit dd5063c72d
2 changed files with 42 additions and 3 deletions

View File

@@ -35,7 +35,8 @@
[datomic.api :as dc]
[hiccup2.core :as hiccup]
[malli.core :as mc]
[auto-ap.ssr.form-cursor :as fc]))
[auto-ap.ssr.form-cursor :as fc]
[clj-time.format :as f]))
(defn filters [request]
[:form {"hx-trigger" "change delay:500ms, keyup changed from:.hot-filter delay:1000ms"
@@ -328,8 +329,13 @@
"Save account"))]]))
(defn new-client-override [{ {:keys [index]} :query-params}]
(html-response
(client-override* {:db/id (str (java.util.UUID/randomUUID))})))
(let [index (or index 0)
account {:account/client-overrides (conj (into [] (repeat index {}))
{:db/id (str (java.util.UUID/randomUUID))})}] ;; TODO schema decode is not working
(html-response
(fc/start-form account []
(fc/with-cursor (get-in fc/*current* [:account/client-overrides index])
(client-override* fc/*current*))))))
(defn account-edit-dialog [request]
(let [account (some-> request :route-params :db/id (#(dc/pull (dc/db conn) default-read %)))]