21 lines
536 B
TypeScript
21 lines
536 B
TypeScript
|
|
import { useQuery } from '@tanstack/react-query';
|
||
|
|
import { api } from '../client';
|
||
|
|
|
||
|
|
export function useCorrelationChain(correlationId: string | null) {
|
||
|
|
return useQuery({
|
||
|
|
queryKey: ['correlation-chain', correlationId],
|
||
|
|
queryFn: async () => {
|
||
|
|
const { data } = await api.POST('/search/executions', {
|
||
|
|
body: {
|
||
|
|
correlationId: correlationId!,
|
||
|
|
limit: 20,
|
||
|
|
sortField: 'startTime',
|
||
|
|
sortDir: 'asc',
|
||
|
|
},
|
||
|
|
});
|
||
|
|
return data;
|
||
|
|
},
|
||
|
|
enabled: !!correlationId,
|
||
|
|
});
|
||
|
|
}
|