kafka-ui/kafka-ui-react-app/src/lib/hooks/api/actuatorInfo.ts
Hrant Abrahamyan f7f2e1dd1f
Fix wrong actuator URL with custom path (#2782)
Co-authored-by: Oleg Shur <workshur@gmail.com>
2022-10-24 23:32:51 +04:00

19 lines
440 B
TypeScript

import { useQuery } from '@tanstack/react-query';
import { BASE_PARAMS, QUERY_REFETCH_OFF_OPTIONS } from 'lib/constants';
const fetchActuatorInfo = async () => {
const data = await fetch(
`${BASE_PARAMS.basePath}/actuator/info`,
BASE_PARAMS
).then((res) => res.json());
return data;
};
export function useActuatorInfo() {
return useQuery(
['actuatorInfo'],
fetchActuatorInfo,
QUERY_REFETCH_OFF_OPTIONS
);
}