mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-10-13 16:41:34 +08:00

* chore: added service name and time params for top level operations * fix: build issues * chore: update the useTopLevelOpertions to send start and end time * chore: added extra checks to not send the param when undefined * chore: added extra checks to not send the param when undefined --------- Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
24 lines
656 B
TypeScript
24 lines
656 B
TypeScript
import getTopLevelOperations, {
|
|
ServiceDataProps,
|
|
} from 'api/metrics/getTopLevelOperations';
|
|
import { QueryKey, useQuery, UseQueryResult } from 'react-query';
|
|
|
|
interface UseGetTopLevelOperationsParams {
|
|
start: number;
|
|
end: number;
|
|
}
|
|
|
|
type UseGetTopLevelOperations = (
|
|
queryKey: QueryKey,
|
|
params: UseGetTopLevelOperationsParams,
|
|
) => UseQueryResult<ServiceDataProps>;
|
|
|
|
const useGetTopLevelOperations: UseGetTopLevelOperations = (queryKey, params) =>
|
|
useQuery<ServiceDataProps>({
|
|
queryKey,
|
|
queryFn: (): Promise<ServiceDataProps> =>
|
|
getTopLevelOperations({ start: params.start, end: params.end }),
|
|
});
|
|
|
|
export default useGetTopLevelOperations;
|