fix(web): name the field in the edit banner on create->fields-error redirect (#28)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-05 15:43:35 +02:00
parent 0c9db7bcdb
commit 0a29127f7e
+5 -3
View File
@@ -17,9 +17,11 @@ export function ObjectEditForm() {
const locationState = location.state as { fieldsError?: boolean; fieldErrorKey?: string } | null; const locationState = location.state as { fieldsError?: boolean; fieldErrorKey?: string } | null;
const [error, setError] = useState<string | null>( const [error, setError] = useState<string | null>(() => {
locationState?.fieldsError ? t("form.rejected") : null, if (locationState?.fieldErrorKey) return t("form.fieldRejected", { field: locationState.fieldErrorKey });
); if (locationState?.fieldsError) return t("form.rejected");
return null;
});
const [fieldErrorKey, setFieldErrorKey] = useState<string | null>( const [fieldErrorKey, setFieldErrorKey] = useState<string | null>(
locationState?.fieldErrorKey ?? null, locationState?.fieldErrorKey ?? null,