fix(ST-511): read create-state errors in Story dialog fieldError

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Janpeter Visser 2026-04-26 21:25:32 +02:00
parent 440c7da8fd
commit 4e45314dd0

View file

@ -98,7 +98,8 @@ export function StoryDialog({ state, onClose, isDemo = false }: StoryDialogProps
)
const fieldError = (field: string) => {
const err = updateResult?.error
const result = isEdit ? updateResult : createResult
const err = result?.error
if (!err || typeof err === 'string') return undefined
return (err as Record<string, string[]>)[field]?.[0]
}