Allows undoing autopayments

This commit is contained in:
2025-02-03 13:34:19 -08:00
parent 329a1dc0d4
commit f1036e257c
4 changed files with 58 additions and 10 deletions

View File

@@ -296,11 +296,18 @@
(try
(handler request)
(catch Throwable e
(if (= :notification (:type (ex-data e)))
(cond
(= :notification (:type (ex-data e)))
{:status 200
:headers {"hx-trigger" (cheshire/generate-string
{"notification" (str (hiccup/html [:div (.getMessage e)]))})
"hx-reswap" "none"}}
(= :warning (:type (ex-data e)))
{:status 200
:headers {"hx-trigger" (cheshire/generate-string
{"notification" (str (hiccup/html [:div (.getMessage e)]))})
"hx-reswap" "none"}} ;; TODO make a warning box so you don't have to reuse the notifaction box, or make it reuse the same box but theme differently
:else
{:status 500
:body (pr-str e)})))))