@ -98,6 +98,20 @@
(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 (<! (db/delete-article client id channel))]
(res/status 200)
(.send res ""))
(catch js/Error err
(defn htmx-create-article-handler-factory
@ -53,6 +53,9 @@
(. app get "/htmx/admin/modals/article/content/:id/"
(handlers/htmx-get-article-preview-content-handler-factory client))
(. app delete "/htmx/admin/rows/article/:id/"
(handlers/htmx-delete-article-row-handler-factory client))
)
(defn start