From bfef190c91b89a4537a072156ebfabdfe43fabbe Mon Sep 17 00:00:00 2001 From: KKlochko Date: Mon, 1 Apr 2024 21:19:59 +0300 Subject: [PATCH] Update the get-article to return data as a cljs map without arrays. --- src/main/blog/db.cljs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/blog/db.cljs b/src/main/blog/db.cljs index 744ae20..941cda3 100644 --- a/src/main/blog/db.cljs +++ b/src/main/blog/db.cljs @@ -2,6 +2,7 @@ (:require ["pg" :refer [Client]] [cljs.core.async :refer [go, take!, put!, >!, chan]] [cljs.core.async.interop :refer-macros [js js->clj]] [blog.env :as env])) (defn create-client @@ -37,8 +38,10 @@ (try (let [res (js [id])))] - (>! channel (.-rows res))) + (clj->js [id])))] + (>! channel (-> (.-rows res) + (js->clj :keywordize-keys true) + (first)))) (catch js/Error err (js/console.log (ex-cause err))))) channel)