This commit is contained in:
2023-10-26 15:54:41 -07:00
parent 8c3d792b28
commit 5ed23f26be
13 changed files with 37 additions and 100 deletions

View File

@@ -102,7 +102,8 @@
(defn parse-empty-as-nil []
(mt2/transformer
{:decoders
{:double empty->nil
{:string empty->nil
:double empty->nil
:int empty->nil
:long empty->nil
'nat-int? empty->nil}}))
@@ -160,10 +161,7 @@
(subs (str k) 1))
;; TODO need to remove or at least remove usages as the form is not included
(defn validation-error [m & {:as data}]
(throw+ (ex-info m (merge data {:type :validation}))))
;; TODO make this bubble the form data automatically
(defn field-validation-error [m path & {:as data}]
(throw+ (ex-info m (merge data {:type :field-validation
:form-errors (assoc-in {} path [m])}))))