Skip to content

Instantly share code, notes, and snippets.

@joshuaNjordan85
Created July 13, 2016 19:10
Show Gist options
  • Save joshuaNjordan85/2b985981f6d51db3f9d8661e9453fba5 to your computer and use it in GitHub Desktop.
Save joshuaNjordan85/2b985981f6d51db3f9d8661e9453fba5 to your computer and use it in GitHub Desktop.
(register-handler :submit-chat
validate-schema-mw
(fn [db [_ chat-msg]]
(let [wolo-id (:active-wolo db)
wolo (filter #(= (:id %) wolo-id) (:wolos db))
chats (:chats wolo)]
(prn "what is wolo" wolo "what are chats" chats)
(conj chats {:usr (gensym "Testing")
:msg chat-msg}))))
@joshuaNjordan85
Copy link
Author

let binding for wolo works find, the chats are never found

@joshuaNjordan85
Copy link
Author

joshuaNjordan85 commented Jul 13, 2016

(def schema {:active-chat s/Any
:active-wolo s/Any ;;change this
:active-view (apply s/enum (keys views))
:wolos [{:id s/Any
:owner s/Str
:title s/Str
:start-time s/Str
:chats [{:usr s/Any
:msg s/Str}]}]})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment