fully removes old invoice experience

This commit is contained in:
2024-08-09 20:32:32 -07:00
parent e947b4592c
commit 1bb8387051
21 changed files with 268 additions and 2333 deletions

View File

@@ -1266,6 +1266,12 @@
[]
{:mode :simple
:has-warning? (boolean has-warning?)}))))
(defn redirect-handler [target-route]
(fn handle [request]
{:status 302
:headers {"Location" (str (hu/url (bidi.bidi/path-for ssr-routes/only-routes
target-route)
(:query-params request)))}}))
(def key->handler
(apply-middleware-to-all-handlers
@@ -1278,6 +1284,12 @@
(wrap-implied-route-param :status :invoice-status/unpaid))
::route/voided-page (-> (helper/page-route grid-page :parse-query-params? false)
(wrap-implied-route-param :status :invoice-status/voided))
::route/legacy-invoices (redirect-handler ::route/all-page)
::route/legacy-import-invoices (redirect-handler ::route/import-page)
::route/legacy-unpaid-invoices (redirect-handler ::route/unpaid-page)
::route/legacy-paid-invoices (redirect-handler ::route/paid-page)
::route/legacy-voided-invoices (redirect-handler ::route/voided-page)
::route/legacy-new-invoice (redirect-handler ::route/new-wizard)
::route/unvoid (-> unvoid-invoice
(wrap-entity [:route-params :db/id] default-read)
(wrap-schema-enforce :route-params [:map [:db/id entity-id]]))