mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-29 16:14:42 +00:00
21 lines
663 B
TypeScript
21 lines
663 B
TypeScript
|
|
import { getIntegrationStatus } from 'api/Integrations/getIntegrationStatus';
|
||
|
|
import { AxiosError, AxiosResponse } from 'axios';
|
||
|
|
import { useQuery, UseQueryResult } from 'react-query';
|
||
|
|
import {
|
||
|
|
GetIntegrationPayloadProps,
|
||
|
|
GetIntegrationStatusProps,
|
||
|
|
} from 'types/api/integrations/types';
|
||
|
|
|
||
|
|
export const useGetIntegrationStatus = ({
|
||
|
|
integrationId,
|
||
|
|
enabled,
|
||
|
|
}: GetIntegrationPayloadProps): UseQueryResult<
|
||
|
|
AxiosResponse<GetIntegrationStatusProps>,
|
||
|
|
AxiosError
|
||
|
|
> =>
|
||
|
|
useQuery<AxiosResponse<GetIntegrationStatusProps>, AxiosError>({
|
||
|
|
queryKey: ['Integration', integrationId, Date.now()],
|
||
|
|
queryFn: () => getIntegrationStatus({ integrationId }),
|
||
|
|
enabled,
|
||
|
|
});
|