Add a feature to preview a article for the admin panel.

This commit is contained in:
2024-04-09 19:49:34 +03:00
parent f78df3d232
commit 20ed9e09dc
5 changed files with 29 additions and 14 deletions
+4 -4
View File
@@ -71,13 +71,13 @@
(do
(res/status 200)
(.render res "article_row"
(-> {:article article :layout false}
(-> {: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
(defn htmx-get-article-preview-content-handler-factory
[client]
(fn [req res]
(let [channel (chan)
@@ -91,8 +91,8 @@
(res/send (ex-message "404")))
(do
(res/status 200)
(.render res "article_row"
(-> {:article article :layout false}
(.render res "admin_article_preview_content"
(-> {:article article :layout false }
(cljs.core/clj->js))))))
(catch js/Error err
(res/status 500)
+3
View File
@@ -40,6 +40,9 @@
(. app get "/htmx/admin/rows/article/:id/"
(handlers/htmx-get-article-row-handler-factory client))
(. app get "/htmx/admin/modals/article/content/:id/"
(handlers/htmx-get-article-preview-content-handler-factory client))
)
(defn start