-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
supportQuestions, discussions, and general supportQuestions, discussions, and general support
Milestone
Description
Hi, using react validation mixin, which uses this library.
I've created my rules:
validatorTypes: ->
patient = Joi.object().keys
forename: Joi.string().min(3).max(100).required().label('Forename')
surname: Joi.string().allow(null).label('Surname')
mobileTelephone: Joi.string().min(3).max(100).required().label('Mobile Telephone')
homeTelephone:Joi.string().min(3).max(100).required().label('Home Telephone')
workTelephone:Joi.string().min(3).max(100).required().label('Work Telephone')
patient.or('mobileTelephone', 'homeTelephone', 'workTelephone')
return Joi.object().keys
patient:patient
The or( isn't behaving like I would expect. I'm expecting one of mobile/home/work phone numbers to be required, however, at the moment it seems to be requiring all 3. I'm also doing some nesting, but I don't think this is the issue.
Thanks,
Chris
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
supportQuestions, discussions, and general supportQuestions, discussions, and general support