Add a feature to preview a article for the admin panel.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user