diff options
Diffstat (limited to 'src/chef/pages/admin.clj')
-rw-r--r-- | src/chef/pages/admin.clj | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/chef/pages/admin.clj b/src/chef/pages/admin.clj index 859dda4..e38dac3 100644 --- a/src/chef/pages/admin.clj +++ b/src/chef/pages/admin.clj @@ -39,11 +39,12 @@ :hx-post (str "/api/admin/create-category" (when (pos? (:categories/id 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"}] + (when (pos? (:categories/id data)) + [: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 [:*] |