feat: add datasource_parameters handling for API requests (#29757)

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
Ryusei Hashimoto
2025-12-17 11:37:55 +09:00
committed by GitHub
parent 581b62cf01
commit 86131d4bd8
2 changed files with 21 additions and 3 deletions

View File

@@ -75,11 +75,17 @@ const OnlineDocuments = ({
const getOnlineDocuments = useCallback(async () => {
const { currentCredentialId } = dataSourceStore.getState()
// Convert datasource_parameters to inputs format for the API
const inputs = Object.entries(nodeData.datasource_parameters || {}).reduce((acc, [key, value]) => {
acc[key] = typeof value === 'object' && value !== null && 'value' in value ? value.value : value
return acc
}, {} as Record<string, any>)
ssePost(
datasourceNodeRunURL,
{
body: {
inputs: {},
inputs,
credential_id: currentCredentialId,
datasource_type: DatasourceType.onlineDocument,
},
@@ -97,7 +103,7 @@ const OnlineDocuments = ({
},
},
)
}, [dataSourceStore, datasourceNodeRunURL])
}, [dataSourceStore, datasourceNodeRunURL, nodeData.datasource_parameters])
useEffect(() => {
if (!currentCredentialId) return