-
Notifications
You must be signed in to change notification settings - Fork 29
Closed
Description
I get an error when trying to implement the ifInvalidEmail validator.
Here's my code (that I copied from the Sign Up Form Example):
type alias Form =
{ email : String
, password : String
}
type Field
= Email
| Password
formValidator : Validator ( Field, String ) Form
formValidator =
Validate.all
[ Validate.firstError
[ ifBlank .email ( Email, "Please enter an email address." )
, ifInvalidEmail .email ( Email, "This is not a valid email address." )
]
, ifBlank .password ( Password, "Please enter a password." )
]and the error is:
The 2nd argument to `ifInvalidEmail` is not what I expect:
129| , ifInvalidEmail .email ( Email, "This is not a valid email address." )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This argument is a tuple of type:
( Field, String )
But `ifInvalidEmail` needs the 2nd argument to be:
String -> error
Same thing happens for ifNotIntvalidators.
Metadata
Metadata
Assignees
Labels
No labels