more low-hanging fruits
This commit is contained in:
parent
4f82709bf2
commit
b2dca4a3f6
20 changed files with 45 additions and 45 deletions
|
|
@ -3,7 +3,7 @@ import { capitalize } from 'lodash'
|
|||
function humanizeErrors(errors) {
|
||||
return Object.entries(errors).reduce((errs, [k, val]) => {
|
||||
const message = val.reduce((acc, message) => {
|
||||
const key = capitalize(k.replace(/_/g, ' '))
|
||||
const key = capitalize(k.replaceAll('_', ' '))
|
||||
return acc + [key, message].join(' ') + '. '
|
||||
}, '')
|
||||
return [...errs, message]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue