Merge pull request #8437 from Budibase/fix/edit-user-validation
User table validation messaging
This commit is contained in:
commit
5275c64f42
|
@ -70,7 +70,11 @@
|
||||||
.map(([key, error]) => ({ dataPath: key, message: error }))
|
.map(([key, error]) => ({ dataPath: key, message: error }))
|
||||||
.flat()
|
.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" }]
|
errors = [{ message: response?.message || "Unknown error" }]
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue