From d658c185d0c56a72b062a234982c5d1f8da49c1c Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 16 May 2025 16:45:13 +0200 Subject: Add feature to delete categories --- src/chef/pages/admin.clj | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/chef/pages/admin.clj') diff --git a/src/chef/pages/admin.clj b/src/chef/pages/admin.clj index 73cf127..83e5dbd 100644 --- a/src/chef/pages/admin.clj +++ b/src/chef/pages/admin.clj @@ -25,6 +25,11 @@ :hx-post (str "/api/admin/create-category" (when (some? data) (str "?parent=" (:categories/id data)))) :hx-swap "none"}] + [:img {:src "/static/icons/trash.svg" :height "30em" + :style {:vertical-align :middle + :margin-left "1em"} + :hx-delete (str "/api/admin/delete-category/" (:categories/id data)) + :hx-swap "none"}] [:ul (for [child children] (render-category child (->> (sql/format {:select [:*] -- cgit v1.2.3