From d1c15fe5fa8d5aac6a7ca056e79ca8872971a9d9 Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Tue, 20 Feb 2018 00:04:08 -0300 Subject: Even more test --- src/clj/queue_api/routes/services.clj | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/clj/queue_api/routes') diff --git a/src/clj/queue_api/routes/services.clj b/src/clj/queue_api/routes/services.clj index 694f0d8..dee949a 100644 --- a/src/clj/queue_api/routes/services.clj +++ b/src/clj/queue_api/routes/services.clj @@ -26,7 +26,10 @@ :return [{:type String :jobs s/Int}] :body-params [agent_id :- String] :summary "Get summary of an agent" - (ok (db/sum-agent agent_id)))) + (let [jobs (db/sum-agent agent_id)] + (map (fn [x] + {:type (first x) + :jobs (last x)}) jobs)))) (context "/job" [] :tags ["job"] @@ -44,7 +47,7 @@ (let [j (db/dequeue-job agent_id)] (if (nil? j) (bad-request {:message "Agent does not exist"}) - (ok {:job_request j}))))) + (ok {:job_request {:job_id j :agent_id agent_id}}))))) (context "/queue" [] :tags ["queue"] -- cgit v1.2.3