Skip to content

Instantly share code, notes, and snippets.


mikos/scratch.clj Secret

Created Mar 24, 2016
What would you like to do?
(defn exists? [result]
(if result
(defmethod compojure.api.meta/restructure-param :exists? [_ v acc]
(update-in acc [:lets] into ['_entry `(exists? (~v (~get-in ~'+compojure-api-request+ [:params :id])))]))
(GET "/:id" []
:path-params [id :- String]
:return (s/maybe Job)
:exists? (fn [id] (find-by-id db org-db id))
(ok _entry))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment