mirror of
https://github.com/penpot/penpot.git
synced 2025-01-10 08:50:57 -05:00
🐛 Fix incorrect error merging mechanism on form validation
This commit is contained in:
parent
e7a8c25883
commit
55ce9bef49
1 changed files with 6 additions and 1 deletions
|
@ -7,6 +7,7 @@
|
|||
(ns app.util.forms
|
||||
(:refer-clojure :exclude [uuid])
|
||||
(:require
|
||||
[app.common.data :as d]
|
||||
[app.common.spec :as us]
|
||||
[app.util.i18n :refer [tr]]
|
||||
[cljs.spec.alpha :as s]
|
||||
|
@ -69,11 +70,15 @@
|
|||
(::s/problems (s/explain-data spec (:data state))))
|
||||
|
||||
errors (reduce interpret-problem {} problems)
|
||||
|
||||
|
||||
errors (reduce (fn [errors vf]
|
||||
(merge errors (vf errors (:data state))))
|
||||
errors
|
||||
validators)
|
||||
errors (merge errors (:errors state))]
|
||||
errors (merge (:errors state) errors)
|
||||
errors (d/without-nils errors)]
|
||||
|
||||
|
||||
(assoc state
|
||||
:errors errors
|
||||
|
|
Loading…
Reference in a new issue