Added :response-format, without that it fails.

Without this line the event fails as the response is not properly formatted.
This commit is contained in:
kapware 2016-10-13 18:29:00 +02:00 committed by GitHub
parent 2ccd95c397
commit 0b23e2ade6
1 changed files with 1 additions and 0 deletions

View File

@ -128,6 +128,7 @@ Here's our rewrite:
;; we return a map of (side) effects
{:http-xhrio {:method :get
:uri "http://json.my-endpoint.com/blah"
:response-format (ajax/json-response-format {:keywords? true}) ;; <-- this is very important, don't forget to require [ajax.core :as ajax]
:on-success [:process-response]
:on-failure [:bad-response]}
:db (assoc db :loading? true)}))