fix extract error from api call

This commit is contained in:
2025-10-09 00:34:57 +02:00
parent 774756a747
commit 4f1452e0d9
4 changed files with 12 additions and 24 deletions

View File

@@ -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 {