Here's a sample error message generated by Loopback for unique item:
{
"error": {
"statusCode": "422",
"name": "Error",
"message": "ER_DUP_ENTRY: Duplicate entry '[email protected]' for key 'email'",
"code": "ER_DUP_ENTRY"
}
}
However, I want to modify it as:
{
"errors": {
"email": [
"The field email should be unique"
]
}
}
Documentation really didn't help me. Can anybody help me on this please?