Files
dify/web/app/components/tools/utils/tool-list-query-key.ts
7cafd65d54 refactor(web): migrate handwritten console API calls to the generated oRPC contract (#44169)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-10-16 03:47:31 +00:00

21 lines
719 B
TypeScript

import type { CollectionProviderType } from '../types'
import { consoleQuery } from '@/service/console'
import { CollectionType } from '../types'
// Each provider type is listed by its own console operation; other provider types have no list.
export const getToolListQueryKey = (type?: CollectionProviderType) => {
const tools = consoleQuery.workspaces.current.tools
switch (type) {
case CollectionType.builtIn:
return tools.builtin.get.queryKey()
case CollectionType.custom:
return tools.api.get.queryKey()
case CollectionType.workflow:
return tools.workflow.get.queryKey()
case CollectionType.mcp:
return tools.mcp.get.queryKey()
default:
return undefined
}
}