Updated the validateSchema util
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
module.exports.validateSchema = (schema, object) => {
|
||||
const {error} = schema.validate(object, {errors: {wrap: {label: ''}}});
|
||||
|
||||
return error ? error.details[0].message : undefined;
|
||||
}
|
||||
return error ? {message: error.details[0].message, field: error.details[0].path[0]}: undefined;
|
||||
}
|
||||
|
Reference in New Issue
Block a user