Sales nearly ready

This commit is contained in:
2024-04-30 22:38:21 -07:00
parent f6dba46835
commit e3b17e50e2
9 changed files with 421 additions and 483 deletions

View File

@@ -439,10 +439,14 @@
:explain
(me/humanize {:errors (assoc me/default-errors
::mc/missing-key {:error/message {:en "required"}})}))
(map (fn [[k v]]
(str (if (keyword? k)
(name k)
k) ": " (str/join ", " v))))
(map (fn [x]
(if (and (sequential? x)
(= (count x) 2))
(let [[k v] x]
(str (if (keyword? k)
(name k)
k) ": " (str/join ", " v))
(str x)))))
(str/join ", "))
{:type :schema-validation
:decoded (:value (:data (ex-data e)))
@@ -539,7 +543,8 @@
{:path (:in e)
:message (get-in humanized (:in e))})
(:errors (:explain (:error e))))]
(alog/warn ::form-4xx :errors errors)
(alog/warn ::form-4xx :errors errors
:data e)
(form-handler (assoc request
:form-params (:decoded e)
:field-validation-errors errors