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
1 changed files with 2 additions and 2 deletions

View File

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