- Add vendor-changed HTMX handlers for both bulk code and individual edit - Pre-populate default account at 100% when vendor is selected and no accounts exist - Fix render-accounts-section to render from step-params correctly - Change bulk code vendor-changed from hx-get to hx-post to include form data - Add routes for vendor-changed endpoints - Update e2e tests to cover vendor pre-population - Run lein cljfmt fix across codebase
29 lines
802 B
Clojure
29 lines
802 B
Clojure
(ns auto-ap.routes.ezcater
|
|
(:require
|
|
[auto-ap.ezcater.core :as e]
|
|
[auto-ap.logging :as alog]
|
|
[ring.middleware.json :refer [wrap-json-params]]))
|
|
|
|
(defn handle-ezcater [{:keys [request-method json-params] :as r}]
|
|
(cond
|
|
(= :get request-method)
|
|
{:status 200
|
|
:headers {"Content-Type" "application/json"}
|
|
:body "{}"}
|
|
|
|
(= :post request-method)
|
|
(do
|
|
(alog/info ::ezcater-request
|
|
:json-params json-params)
|
|
(e/import-order json-params)
|
|
{:status 200
|
|
:headers {"Content-Type" "application/json"}
|
|
:body "{}"})
|
|
|
|
:else
|
|
{:status 404}))
|
|
|
|
(def routes {"api/" {"ezcater/" {#"event/?" :ezcater-event}}})
|
|
(def match->handler {:ezcater-event (-> handle-ezcater
|
|
wrap-json-params)})
|