-
-
Save bhenry/8a0063cd28d55e0f1799 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;from cljs namespace util | |
(defn fields->map [& ks] | |
(into {} | |
(for [k ks] | |
[k (js->clj (j/val ($id->elem k)))]))) | |
;;from cljs namespace manage | |
(defn submit-group-form [] | |
(let [g (util/fields->map :grpname :grpsubs)] | |
(fm/letrem [grp (add-group g)] | |
(if (= :success grp) | |
(do (state/trigger app :select-page "manage") | |
(state/unset app :form-submitted "grp-form")) | |
(state/unset app :form-submitted "grp-form" "Invalid Form Data"))))) | |
;;from clj namespace remotes | |
(defremote add-group [grp] | |
(prn grp)) | |
;;result of prn : | |
;;{:grpname "MEFASupervisor", :grpsubs ["[object Object]"]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment