Fix: optional input in batch run (#19257)

This commit is contained in:
KVOJJJin
2025-05-06 11:33:15 +08:00
committed by GitHub
parent b979a8a707
commit 4b77c9df9d
2 changed files with 11 additions and 4 deletions

View File

@@ -45,7 +45,7 @@ const RunOnce: FC<IRunOnceProps> = ({
const onClear = () => {
const newInputs: Record<string, any> = {}
promptConfig.prompt_variables.forEach((item) => {
if (item.type === 'text-input' || item.type === 'paragraph')
if (item.type === 'string' || item.type === 'paragraph')
newInputs[item.key] = ''
else
newInputs[item.key] = undefined
@@ -66,7 +66,7 @@ const RunOnce: FC<IRunOnceProps> = ({
useEffect(() => {
const newInputs: Record<string, any> = {}
promptConfig.prompt_variables.forEach((item) => {
if (item.type === 'text-input' || item.type === 'paragraph')
if (item.type === 'string' || item.type === 'paragraph')
newInputs[item.key] = ''
else
newInputs[item.key] = undefined