fixed issue with yodlee dates.

This commit is contained in:
Bryce Covert
2019-02-23 15:32:55 -08:00
parent 00e2c64317
commit 2a7068fa69
4 changed files with 47 additions and 31 deletions

View File

@@ -140,10 +140,20 @@
(let [headers (if token
{"Authorization" (str "Token " token)}
{})
method (if (= (get-in query-obj [:venia/operation :operation/type]) :mutation)
:post
:get)
headers (if (= method :post)
(assoc headers "Content-Type" "text/plain")
headers
)
query (or query (v/graphql-query (->graphql query-obj)))
response (<! (http/request {:method :get
response (<! (http/request {:method method
:headers headers
:url (str "/api/graphql?query=" (js/encodeURIComponent query)
:body (when = (:post method) query)
:url (str "/api/graphql?query=" (when (= :get method) (js/encodeURIComponent query))
"&variables=" (pr-str (or variables {})))}))]
(if (>= (:status response) 400)
(when on-error