mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-31 00:16:47 +01:00
fix: use instance status too many reqs (#2651)
Same as https://github.com/Unleash/unleash/pull/2650 but for `useInstanceStatus`, since it followed a similar pattern.
This commit is contained in:
parent
1e8801b652
commit
1bd95d44e5
@ -2,7 +2,6 @@ import { IInstanceStatus, InstancePlan } from 'interfaces/instance';
|
||||
import { useApiGetter } from 'hooks/api/getters/useApiGetter/useApiGetter';
|
||||
import { formatApiPath } from 'utils/formatPath';
|
||||
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
export interface IUseInstanceStatusOutput {
|
||||
instanceStatus?: IInstanceStatus;
|
||||
@ -20,14 +19,10 @@ export const useInstanceStatus = (): IUseInstanceStatusOutput => {
|
||||
} = uiConfig;
|
||||
|
||||
const { data, refetch, loading, error } = useApiGetter(
|
||||
'useInstanceStatus',
|
||||
['useInstanceStatus', UNLEASH_CLOUD],
|
||||
() => fetchInstanceStatus(UNLEASH_CLOUD)
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
refetch();
|
||||
}, [refetch, UNLEASH_CLOUD]);
|
||||
|
||||
const billingPlans = [
|
||||
InstancePlan.PRO,
|
||||
InstancePlan.COMPANY,
|
||||
|
Loading…
Reference in New Issue
Block a user