luminus

2020-08-09T00:19:14.055Z

hey everyone i am using luminus for the first time and i cant seem to have the server return the queried data

2020-08-09T00:20:01.055800Z

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

dvliman 2020-08-11T16:18:48.057500Z

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}))

2020-08-09T00:20:11.056Z

the query looks like this

-- :name get-job :? :1
-- :doc retrieves a job record given the id
SELECT * from job
WHERE id = :id