MCPcopy Index your code
hub / github.com/simstudioai/sim / useLogByExecutionId

Function useLogByExecutionId

apps/sim/hooks/queries/logs.ts:203–222  ·  view source on GitHub ↗
(
  workspaceId: string | undefined,
  executionId: string | null | undefined
)

Source from the content-addressed store, hash-verified

201}
202
203export function useLogByExecutionId(
204 workspaceId: string | undefined,
205 executionId: string | null | undefined
206) {
207 const queryClient = useQueryClient()
208 return useQuery({
209 queryKey: logKeys.byExecution(workspaceId, executionId ?? undefined),
210 queryFn: async ({ signal }) => {
211 const { data } = await requestJson(getLogByExecutionIdContract, {
212 params: { executionId: executionId as string },
213 query: { workspaceId: workspaceId as string },
214 signal,
215 })
216 queryClient.setQueryData(logKeys.detail(workspaceId, data.id), data)
217 return data
218 },
219 enabled: Boolean(workspaceId) && Boolean(executionId),
220 staleTime: 30 * 1000,
221 })
222}
223
224export function prefetchLogDetail(queryClient: QueryClient, logId: string, workspaceId: string) {
225 queryClient.prefetchQuery({

Callers 2

LogsFunction · 0.90
TableFunction · 0.90

Calls 1

requestJsonFunction · 0.90

Tested by

no test coverage detected