change parameter order

integration-tests
Josha von Gizycki 7 years ago
parent 4ba0d397e9
commit 8c0631fe66

@ -14,7 +14,7 @@
[:span.flash__pred (:pred prob)]]) [:span.flash__pred (:pred prob)]])
(:clojure.spec.alpha/problems spec-data)))) (:clojure.spec.alpha/problems spec-data))))
(defn field [req form-def field] (defn field [form-def field req]
(let [field-value (get-in req [:params field]) (let [field-value (get-in req [:params field])
field-def (get-in form-def [:fields field]) field-def (get-in form-def [:fields field])
{:keys [label required] spec-key :spec} field-def {:keys [label required] spec-key :spec} field-def

@ -33,12 +33,12 @@
[:h1 "Pali sin e jaki ijo"] [:h1 "Pali sin e jaki ijo"]
(hform/form-to (hform/form-to
[:post "/schema/new"] [:post "/schema/new"]
(forms/field req new-schema-form :schema-name) (forms/field new-schema-form :schema-name req)
(hform/submit-button "Pali") (hform/submit-button "Pali")
(anti-forgery-field))]))) (anti-forgery-field))])))
(defn- new! [req] (defn- new! [req]
(if (forms/valid? req new-schema-form) (if (forms/valid? new-schema-form req)
(resp/redirect "/schema") (resp/redirect "/schema")
(overview! req))) (overview! req)))

Loading…
Cancel
Save