This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-21
Channels
- # bangalore-clj (1)
- # beginners (60)
- # boot (30)
- # cider (7)
- # cljs-dev (10)
- # cljsrn (2)
- # clojure (163)
- # clojure-conj (10)
- # clojure-france (1)
- # clojure-greece (2)
- # clojure-italy (7)
- # clojure-russia (41)
- # clojure-serbia (22)
- # clojure-spec (41)
- # clojure-uk (41)
- # clojurescript (178)
- # cursive (36)
- # datascript (1)
- # datomic (23)
- # dirac (38)
- # graphql (12)
- # hoplon (20)
- # immutant (32)
- # instaparse (3)
- # keechma (1)
- # lein-figwheel (18)
- # leiningen (8)
- # liberator (1)
- # luminus (30)
- # lumo (29)
- # off-topic (18)
- # om (17)
- # pedestal (7)
- # planck (37)
- # precept (1)
- # re-frame (67)
- # ring-swagger (2)
- # timbre (1)
- # untangled (8)
- # vim (2)
I'm having a hard time to get a clojurescript frontend working for the vase-component sample app. GET requests work fine, but i've tried several different ways to POST a new "pet" to the db without any luck. I can succesfully post to the DB with clj-http, for example with
(http/post ""
{:form-params
{:payload [{:pet-store.pet/id 101
:pet-store.pet/name "harry"
:pet-store.pet/tag "harry's tag"
}]}
:content-type :json})
But I can't seem to figure out how to make this work from clojurescript after attempting with jquery and cljs-ajax, attempting to use json and edn. Are there any examples of using vase with clojurescript?here's my attempt with cljs-ajax:
(ajax/POST ""
:params {:payload [{:pet-store.pet/id 102
:pet-store.pet/name "harry"
:pet-store.pet/tag "harry's tag"
}]}
:format :json ;(ajax-edn/edn-request-format) ;;attempt edn and json formats
)
but it results in {whitelist [{}], transaction [[nil nil nil] [nil nil nil] [nil nil nil] [nil nil nil]]}
OK I actually just got the above example working buy using string keys such as "pet-store.pet/id 102"
so that should work for now. Is there something I have to do server-side to accept EDN? The docs seemed to suggest it should automatically be able to accept edn if the content type was correctly set
@mtnygard: I'm working through the guides, and I'm having some difficulty with http://pedestal.io/guides/hello-world-content-types - specifically, how to map the 'cond->' macro portion back to the original version. I've never actually needed to use 'cond->' so I'm happy to figure out how it works, but I think it would be worth putting a more beginner friendly version in as an intermediate step - so far it's been the only real stumbling block I've found if I assume it's geared towards beginners.
@mtnygard: I just opened an issue on the docs site - sorry, I should have done that first!
hey folks, I read somewhere that extending pedestal is easy because everything are protocols , right ? i yes, can you give me an quick example
Is there any guidance on when to syntax quote interceptors? Tutorials all go without it, but the lein template uses it.