Closed boldt closed 8 years ago
I put together a test for this. It looks like all you need to do is the following:
getValidationMessages('thumbnail.height')
Technically thumbnail
is just an object but height
is the Joi schema.
This should work the same way as asking if this field is valid or to validate the field:
this.props.isValid('thumbnail.height')
this.props.handleValidation'(thumbnail.height')
this.props.getValidationMessages('thumbnail.height')
Imagine the following Joi:
Calling
getValidationMessages('thumbnail')
returns me the following error:Uncaught TypeError: html.replace is not a function
Stacktrace:
The issue is simple:
decode.js
does not check for objects. Thus,replace
is called on an object instead of a string.