-
-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
The documentation shows this example :
vine.group([
vine.group.if((data) => 'username' in data, {
username: vine.string()
}),
vine.group.if((data) => 'email' in data, {
email: vine.string().email()
})
])
.otherwise((field) => {
field.report(
'You must provide username or email to login',
'email_or_username',
field
)
})
This example does not work. otherwise
need two parameters : value and field. It needs to be corrected like the example with union :
vine.group([
vine.group.if((data) => 'username' in data, {
username: vine.string()
}),
vine.group.if((data) => 'email' in data, {
email: vine.string().email()
})
])
.otherwise((_, field) => {
field.report(
'You must provide username or email to login',
'email_or_username',
field
)
})
volchan
Metadata
Metadata
Assignees
Labels
No labels