1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-01 01:18:10 +02:00
unleash.unleash/frontend/src/hooks/api/getters/useOutdatedSdks/useOutdatedSdks.ts
2024-03-14 10:15:33 +01:00

15 lines
467 B
TypeScript

import { fetcher, useApiGetter } from '../useApiGetter/useApiGetter';
import { OutdatedSdksSchema } from '../../../../openapi';
const PATH = 'api/admin/metrics/sdks/outdated';
export const useOutdatedSdks = () => {
const { data, refetch, loading, error } = useApiGetter<OutdatedSdksSchema>(
PATH,
() => fetcher(PATH, 'Outdated SDKs'),
{ refreshInterval: 60 * 1000 },
);
return { data: data || { sdks: [] }, refetch, error };
};