(ns blog.handlers (:require [cljs.core.async :refer [go, take!, put!, !, chan]] [cljs.core.async.interop :refer-macros [
{:articles articles} (cljs.core/clj->js)))) (catch js/Error err (res/status 500) (res/send (ex-message err)))))))) (defn admin-panel-handler-factory [client] (fn [req res] (let [channel (chan) id (.-id (.-params req))] (go (try (let [articles ( {:articles articles} (cljs.core/clj->js)))) (catch js/Error err (res/status 500) (res/send (ex-message err)))))))) (defn htmx-get-article-handler-factory [client] (fn [req res] (let [channel (chan) id (.-id (.-params req))] (go (try (let [article ( {:article article :layout false} (cljs.core/clj->js)))))) (catch js/Error err (res/status 500) (res/send (ex-message err)))))))) (defn htmx-get-article-row-handler-factory [client] (fn [req res] (let [channel (chan) id (.-id (.-params req))] (go (try (let [article ( {:article article :layout false } (cljs.core/clj->js)))))) (catch js/Error err (res/status 500) (res/send (ex-message err)))))))) (defn htmx-get-article-preview-content-handler-factory [client] (fn [req res] (let [channel (chan) id (.-id (.-params req))] (go (try (let [article ( {:article article :layout false } (cljs.core/clj->js)))))) (catch js/Error err (res/status 500) (res/send (ex-message err)))))))) (defn htmx-delete-article-row-handler-factory [client] (fn [req res] (let [channel (chan) id (.-id (.-params req))] (go (try (let [id ( {:articles articles :layout false} (cljs.core/clj->js)))) (catch js/Error err (res/status 500) (res/send (ex-message err)))))))) (defn htmx-create-article-handler-factory [client] (fn [req res] (let [channel (chan) title (.-title (.-body req)) content (.-content (.-body req))] (go (try (let [id (