mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-01 07:45:22 +03:00
Fix check for validation errors in Form API.
This commit is contained in:
parent
78cc936272
commit
1675b1bebb
12
src/Form.elm
12
src/Form.elm
@ -1917,8 +1917,13 @@ toRequest2 ((Form fields decoder serverValidations modelToValue) as form) =
|
||||
(\model ->
|
||||
case decoded of
|
||||
Ok ( value, otherValidationErrors ) ->
|
||||
--if not (hasErrors validationErrors) && (otherValidationErrors |> List.isEmpty) then
|
||||
if otherValidationErrors |> List.isEmpty then
|
||||
if
|
||||
otherValidationErrors
|
||||
|> List.any
|
||||
(\( a, entryErrors ) ->
|
||||
entryErrors |> List.isEmpty
|
||||
)
|
||||
then
|
||||
Ok ( model, value )
|
||||
|
||||
else
|
||||
@ -1998,7 +2003,8 @@ submitHandlers myForm toDataSource =
|
||||
|> toDataSource model
|
||||
|
||||
Err model ->
|
||||
Err () |> toDataSource model
|
||||
Err ()
|
||||
|> toDataSource model
|
||||
)
|
||||
-- TODO allow customizing headers or status code, or not?
|
||||
|> DataSource.map Server.Response.render
|
||||
|
Loading…
Reference in New Issue
Block a user