1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-24 17:51:14 +02:00

chore: clean up hook

This commit is contained in:
Nuno Góis 2025-09-02 14:08:14 +01:00
parent 9d2cde849f
commit cde4aa8b48
No known key found for this signature in database
GPG Key ID: 71ECC689F1091765

View File

@ -1,8 +1,8 @@
import { useMemo } from 'react';
import { formatApiPath } from 'utils/formatPath';
import { useConditionalSWR } from 'hooks/api/getters/useConditionalSWR/useConditionalSWR.js';
import handleErrorResponses from 'hooks/api/getters/httpErrorResponseHandler';
import type { SWRConfiguration } from 'swr';
import useSWR from 'swr';
type UnknownFlagEnvReport = {
environment: string;
@ -31,9 +31,7 @@ const DEFAULT_DATA: UnknownFlagsResponse = {
};
export const useUnknownFlags = (options?: SWRConfiguration) => {
const { data, error, mutate } = useConditionalSWR<UnknownFlagsResponse>(
true,
DEFAULT_DATA,
const { data, error, mutate } = useSWR<UnknownFlagsResponse>(
formatApiPath(ENDPOINT),
fetcher,
options,