Types
Decodes errors passed from rails formatted like this:
{ errors: {errorName: ["Error String"] } }.
This function takes a Dict that is a map of all the fields you need decoded. It should look like this:
Dict.fromList
[ ( "school", School )
, ( "school.name", SchoolName )
, ( "school.address", SchoolAddress )
, ( "school.city", City )
, ( "school.state", State )
, ( "school.zip", Zip )
, ( "school.country", Country )
]
ErrorList is a type alias for a list of
( fields, String )pairs, wherefieldis a type we can use to reference which fields had errors.