mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-19 00:15:43 +01:00
fix: don't check license in OSS (#9277)
The license check API call was giving me 404s in the console of the OSS version of Unleash. This changes the `useLicense` hook to use `useEnterpriseSWR` instead of `useSWR` to avoid making the API call in the OSS version. This is consistent with the `useLicenseCheck` hook in the same file.
This commit is contained in:
parent
c4fa86b1aa
commit
c3cef5be18
@ -1,4 +1,3 @@
|
|||||||
import useSWR from 'swr';
|
|
||||||
import { formatApiPath } from 'utils/formatPath';
|
import { formatApiPath } from 'utils/formatPath';
|
||||||
import handleErrorResponses from '../httpErrorResponseHandler';
|
import handleErrorResponses from '../httpErrorResponseHandler';
|
||||||
import { useEnterpriseSWR } from '../useEnterpriseSWR/useEnterpriseSWR';
|
import { useEnterpriseSWR } from '../useEnterpriseSWR/useEnterpriseSWR';
|
||||||
@ -51,7 +50,8 @@ export const useLicenseCheck = (): LicenseInfo => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const useLicense = (): License => {
|
export const useLicense = (): License => {
|
||||||
const { data, error, mutate } = useSWR(
|
const { data, error, mutate } = useEnterpriseSWR(
|
||||||
|
undefined,
|
||||||
formatApiPath(`api/admin/license`),
|
formatApiPath(`api/admin/license`),
|
||||||
fetcher,
|
fetcher,
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user