1
0
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:
Thomas Heartman 2025-02-10 15:16:34 +01:00 committed by GitHub
parent c4fa86b1aa
commit c3cef5be18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,3 @@
import useSWR from 'swr';
import { formatApiPath } from 'utils/formatPath';
import handleErrorResponses from '../httpErrorResponseHandler';
import { useEnterpriseSWR } from '../useEnterpriseSWR/useEnterpriseSWR';
@ -51,7 +50,8 @@ export const useLicenseCheck = (): LicenseInfo => {
};
export const useLicense = (): License => {
const { data, error, mutate } = useSWR(
const { data, error, mutate } = useEnterpriseSWR(
undefined,
formatApiPath(`api/admin/license`),
fetcher,
);