fix extract error from api call
This commit is contained in:
@@ -68,11 +68,11 @@ export function genericPostCall(apiRoute, object) {
|
||||
}
|
||||
}
|
||||
|
||||
export function extractFromErrorFromField(fieldName, errors) {
|
||||
if (errors === null || !('field' in errors)) {
|
||||
export function extractFormErrorFromField(fieldName, errors) {
|
||||
if (errors === null) {
|
||||
return "";
|
||||
}
|
||||
const titleErr = errs.find((e) => e["field"] === fieldName);
|
||||
const titleErr = errors.find((e) => e["field"] === fieldName);
|
||||
if (typeof titleErr !== 'undefined') {
|
||||
return titleErr.error;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user