Express-Validator module uses a new function: req.getValidationResult() This function returns an object if there are any errors in validation. The object looks like:
{param: "field name", msg: "error message", value: "<field input value>"}
The question is - how to return a .msg parameter from an object? When I use
req.getValidationResult().then(function(result){
if(!result.isEmpty()) {
console.log(result.array());
//return;
} else {
console.log('Validation Ok');
}
the function returns an array. But I need only .msg.