mirror of
https://github.com/langgenius/dify.git
synced 2026-04-23 00:18:22 +08:00
fix: update checkValidFns type to Partial and ensure error message fallback in useOneStepRun
This commit is contained in:
parent
000e8bd12b
commit
fcfade4778
@ -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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user