Fix form error display for root-level validation errors
When validation errors occur at the root level (e.g., from :fn validators in multi schemas), they are returned as a vector directly rather than a map with :errors key. Update default-step-footer to handle both cases.
This commit is contained in:
@@ -148,7 +148,9 @@
|
|||||||
next-button-content]}]
|
next-button-content]}]
|
||||||
[:div.flex.justify-end
|
[:div.flex.justify-end
|
||||||
[:div.flex.items-baseline.gap-x-4
|
[:div.flex.items-baseline.gap-x-4
|
||||||
(com/form-errors {:errors (:errors (:step-params fc/*form-errors*))})
|
(let [step-errors (:step-params fc/*form-errors*)]
|
||||||
|
(com/form-errors {:errors (or (:errors step-errors)
|
||||||
|
(when (sequential? step-errors) step-errors))}))
|
||||||
(when (not= (first (steps linear-wizard))
|
(when (not= (first (steps linear-wizard))
|
||||||
(step-key step))
|
(step-key step))
|
||||||
(when validation-route
|
(when validation-route
|
||||||
|
|||||||
Reference in New Issue
Block a user