-
-
Save mheld/dc289aa7c5dfc7612ac2d6ba414aeb74 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
(r/reg-event-fx | |
:login | |
(fn [{:keys [db]} [_ email password]] | |
{:db (assoc-in db [:pages :loading?] true) | |
:http-xhrio {:method :post | |
:uri "http://localhost:3000/api/v1/auth/sign_in.json" ; todo: dynamic URLs! | |
:timeout 8000 | |
:format :json | |
:keywords? :true | |
:params {:email email :password password} | |
:response-format (json-response-format {:keywords? true}) ;; optional see API docs | |
:on-success [:good-login] | |
:on-failure [:bad-http-result "sometihng went wrong..."]}})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment