Add a helper for global errors.

This commit is contained in:
Dillon Kearns 2022-07-27 18:54:35 +02:00
parent bce99b7ea5
commit c9b2ee3b9d

View File

@ -11,6 +11,7 @@ module Form exposing
, runOneOfServerSideWithServerValidations
, AppContext
-- subGroup
, globalErrors
)
{-| One of the core features of elm-pages is helping you manage form data end-to-end, including
@ -755,6 +756,12 @@ errorsForField field_ (Errors errorsDict) =
|> Maybe.withDefault []
{-| -}
globalErrors : Errors error -> List error
globalErrors errors =
errors |> errorsForField Validation.global
{-| -}
type alias AppContext app =
{ app