mirror of
https://github.com/langgenius/dify.git
synced 2026-05-01 07:58:02 +08:00
step run of human input
This commit is contained in:
@ -61,18 +61,28 @@ const useSingleRunFormParams = ({
|
||||
const fetchURL = useMemo(() => {
|
||||
if (!appId)
|
||||
return ''
|
||||
if (isWorkflowMode) {
|
||||
return `/apps/${appId}/advanced-chat/workflows/draft/human_input/nodes/${id}/form`
|
||||
if (!isWorkflowMode) {
|
||||
return `/apps/${appId}/advanced-chat/workflows/draft/human-input/nodes/${id}/form`
|
||||
}
|
||||
else {
|
||||
return `/apps/${appId}/workflows/draft/human_input/nodes/${id}/form`
|
||||
return `/apps/${appId}/workflows/draft/human-input/nodes/${id}/form`
|
||||
}
|
||||
}, [appId, id, isWorkflowMode])
|
||||
|
||||
const handleFetchFormContent = useCallback(async (inputs: Record<string, any>) => {
|
||||
if (!fetchURL)
|
||||
return null
|
||||
const data = await fetchHumanInputNodeStepRunForm(fetchURL, { inputs })
|
||||
let requestParamsObj
|
||||
Object.keys(inputs).forEach((key) => {
|
||||
if (inputs[key] === undefined) {
|
||||
delete inputs[key]
|
||||
}
|
||||
})
|
||||
requestParamsObj = { ...inputs }
|
||||
if (Object.keys(requestParamsObj).length === 0) {
|
||||
requestParamsObj = undefined
|
||||
}
|
||||
const data = await fetchHumanInputNodeStepRunForm(fetchURL, { inputs: requestParamsObj! })
|
||||
setFormData(data)
|
||||
return data
|
||||
}, [fetchURL])
|
||||
|
||||
Reference in New Issue
Block a user