const mongooseValidation = (theError) => {
const errors = {}
const details = errors.theError
for (const key in details)
{
errors[key] = [details[key].message]
}
return errors
}
module.exports = mongooseValidation
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter