Files
Dorod-Sky/skyvern-frontend/src/routes/workflows/hooks/useDebugSessionBlockOutputsQuery.ts
2025-08-29 13:30:53 -04:00

26 lines
832 B
TypeScript

import { getClient } from "@/api/AxiosClient";
import { useCredentialGetter } from "@/hooks/useCredentialGetter";
import { useQuery } from "@tanstack/react-query";
type Props = {
workflowPermanentId?: string;
};
function useDebugSessionBlockOutputsQuery({ workflowPermanentId }: Props) {
const credentialGetter = useCredentialGetter();
return useQuery<{ [k: string]: { extracted_information: unknown } }>({
queryKey: ["block-outputs", workflowPermanentId],
queryFn: async () => {
const client = await getClient(credentialGetter, "sans-api-v1");
const result = await client
.get(`/debug-session/${workflowPermanentId}/block-outputs`)
.then((response) => response.data);
return result;
},
enabled: !!workflowPermanentId,
});
}
export { useDebugSessionBlockOutputsQuery };