fix: update checkValidFns type to Partial and ensure error message fallback in useOneStepRun

This commit is contained in:
zhsama 2025-11-06 14:51:32 +08:00
parent 000e8bd12b
commit fcfade4778

View File

@ -70,7 +70,7 @@ import {
} from '@/service/use-tools' } from '@/service/use-tools'
// eslint-disable-next-line ts/no-unsafe-function-type // eslint-disable-next-line ts/no-unsafe-function-type
const checkValidFns: Record<BlockEnum, Function> = { const checkValidFns: Partial<Record<BlockEnum, Function>> = {
[BlockEnum.LLM]: checkLLMValid, [BlockEnum.LLM]: checkLLMValid,
[BlockEnum.KnowledgeRetrieval]: checkKnowledgeRetrievalValid, [BlockEnum.KnowledgeRetrieval]: checkKnowledgeRetrievalValid,
[BlockEnum.IfElse]: checkIfElseValid, [BlockEnum.IfElse]: checkIfElseValid,
@ -631,7 +631,7 @@ const useOneStepRun = <T>({
}) })
Toast.notify({ Toast.notify({
type: 'error', type: 'error',
message: res.errorMessage, message: res.errorMessage || '',
}) })
} }
return res return res