Merge pull request #8437 from Budibase/fix/edit-user-validation
User table validation messaging
This commit is contained in:
commit
a0ae4fc7f4
1 changed files with 5 additions and 1 deletions
|
@ -70,7 +70,11 @@
|
|||
.map(([key, error]) => ({ dataPath: key, message: error }))
|
||||
.flat()
|
||||
}
|
||||
} else if (error.status === 400) {
|
||||
} else if (error.status === 400 && response?.validationErrors) {
|
||||
errors = Object.keys(response.validationErrors).map(field => ({
|
||||
message: `${field} ${response.validationErrors[field][0]}`,
|
||||
}))
|
||||
} else {
|
||||
errors = [{ message: response?.message || "Unknown error" }]
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue