hey everyone i am using luminus for the first time and i cant seem to have the server return the queried data
routes
(defn job-routes
[]
["/job"
{:middleware [middleware/wrap-csrf
middleware/wrap-formats]}
["/search" {:get job-service/search}]
["/:id" {:get job-service/find-by-id}]])
service
(defn find-by-id
[request]
(let [id (-> request :path-params :id)]
((db/get-job {:id id}))))
when i print db/get-job
the map is printed out, however when i query this endpoint via Postman it just returned 1
I think you have an extra parens at ((db/get-job ....))
- I should jut be (db/get-job...)
You can try printing the result
(let [id (-> request :path-params :id)
_ (prn (db/get-job {:id id}]
(db/get-job {:id id}))
the query looks like this
-- :name get-job :? :1
-- :doc retrieves a job record given the id
SELECT * from job
WHERE id = :id