diff --git a/src/main/blog/handlers.cljs b/src/main/blog/handlers.cljs index 8559c6a..9408a6c 100644 --- a/src/main/blog/handlers.cljs +++ b/src/main/blog/handlers.cljs @@ -104,6 +104,43 @@ (res/status 500) (res/send (ex-message err)))))))) +(defn htmx-get-article-edit-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-update-article-handler-factory + [client] + (fn [req res] + (let [channel (chan) + article {:id (.-id (.-params req)) + :title (.-title (.-body req)) + :content (.-content (.-body req))}] + (go + (try + (let [id ( -
+ diff --git a/views/partials/article_row.hbs b/views/partials/article_row.hbs index 5a1c461..7288c2c 100644 --- a/views/partials/article_row.hbs +++ b/views/partials/article_row.hbs @@ -1,5 +1,5 @@