Include client validations in server response.

This commit is contained in:
Dillon Kearns 2022-01-06 11:02:56 -08:00
parent 3522ed2b66
commit 2e4f87767f

View File

@ -724,8 +724,18 @@ with (Field field) (Form fields decoder serverValidations modelToValue) =
(field.serverValidation arg2
|> DataSource.map
(\validationErrors ->
let
clientErrors : List String
clientErrors =
case field.decode arg2 of
Ok _ ->
[]
Err error ->
[ error ]
in
( field.name
, { errors = validationErrors
, { errors = validationErrors ++ clientErrors
, raw = arg2
}
)