(
workspaceId?: string,
options?: {
enabled?: boolean
scope?: KnowledgeQueryScope
}
)
| 224 | } |
| 225 | |
| 226 | export function useKnowledgeBasesQuery( |
| 227 | workspaceId?: string, |
| 228 | options?: { |
| 229 | enabled?: boolean |
| 230 | scope?: KnowledgeQueryScope |
| 231 | } |
| 232 | ) { |
| 233 | const scope = options?.scope ?? 'active' |
| 234 | return useQuery({ |
| 235 | queryKey: knowledgeKeys.list(workspaceId, scope), |
| 236 | queryFn: ({ signal }) => fetchKnowledgeBases(workspaceId, scope, signal), |
| 237 | enabled: options?.enabled ?? true, |
| 238 | staleTime: 60 * 1000, |
| 239 | placeholderData: keepPreviousData, |
| 240 | }) |
| 241 | } |
| 242 | |
| 243 | export function useKnowledgeBaseQuery(knowledgeBaseId?: string) { |
| 244 | return useQuery({ |
no test coverage detected