Fixed display errors from API in front
This commit is contained in:
@@ -159,6 +159,10 @@ export function extractFormErrorFromField(fieldName, errors) {
|
|||||||
if (errors === null) {
|
if (errors === null) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
if (errors.value == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
console.log(errors.value);
|
||||||
const titleErr = errors.find((e) => e["field"] === fieldName);
|
const titleErr = errors.find((e) => e["field"] === fieldName);
|
||||||
if (typeof titleErr !== 'undefined') {
|
if (typeof titleErr !== 'undefined') {
|
||||||
return titleErr.error;
|
return titleErr.error;
|
||||||
|
|||||||
Reference in New Issue
Block a user