This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-14
Channels
- # beginners (33)
- # boot (38)
- # clara (21)
- # cljs-dev (1)
- # cljsjs (2)
- # cljsrn (12)
- # clojure (230)
- # clojure-argentina (1)
- # clojure-brasil (3)
- # clojure-dusseldorf (4)
- # clojure-france (9)
- # clojure-italy (1)
- # clojure-russia (123)
- # clojure-spec (46)
- # clojure-turkiye (1)
- # clojure-uk (60)
- # clojurescript (83)
- # core-async (6)
- # cursive (10)
- # datascript (19)
- # datomic (28)
- # defnpodcast (1)
- # emacs (7)
- # figwheel (7)
- # fulcro (29)
- # leiningen (29)
- # lumo (9)
- # off-topic (14)
- # om (1)
- # onyx (25)
- # pedestal (1)
- # protorepl (3)
- # re-frame (10)
- # reagent (41)
- # ring-swagger (11)
- # shadow-cljs (10)
- # testing (5)
- # unrepl (3)
- # vim (3)
I expressed that opinion on HN and was astounded to learn that there are people who write that file by hand
I would like to create my own metadata handler named :filter which would extract common filters from query-params so I don't have to repeat it in every GET endpoint. However I got stucked on No method in multimethod 'restructure-param' for dispatch value: :filter
(defmethod restructure-param :filter
[_ binding acc]
(update-in acc [:letks] into [binding `(:query-params ~'+compojure-api-request+)]))
typo, I've edited it - it's not working anyway
I guess you should use proper namespace compojure.api.meta
: https://github.com/metosin/compojure-api/wiki/Creating-your-own-metadata-handlers#example
[compojure.api.meta :refer [restructure-param]]
that's what I am using 🙂
do you have the ns with the custom restructuring imported from all namespaces where it is used? mms have global state.
having that code evaluated once before any routes are resolved works. But with tools-refresh & repl, the multimethod can end up in a dirty state.
@ikitommi yes, that solved it, thanks a lot 🙂