Skip to content

Commit 23cfca8

Browse files
authored
FE: Disable fetch loa hook (#1684)
1 parent ea740d1 commit 23cfca8

File tree

1 file changed

+3
-0
lines changed
  • frontend/src/features/settings/hooks

1 file changed

+3
-0
lines changed

frontend/src/features/settings/hooks/LOA.ts

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
removeLOADocument,
1414
updateLOA,
1515
} from "../apiManager/loa";
16+
import { useFeatureFlagsQuery } from "../../../common/hooks/hooks";
1617

1718
const QUERY_KEYS = {
1819
LOAS: (expired: boolean) => ["loas", expired],
@@ -26,11 +27,13 @@ const QUERY_KEYS = {
2627
* @returns Query result of the company's LOAs
2728
*/
2829
export const useFetchLOAs = (companyId: number | string, expired: boolean) => {
30+
const {data: featureFlags} = useFeatureFlagsQuery();
2931
return useQuery({
3032
queryKey: QUERY_KEYS.LOAS(expired),
3133
queryFn: () => getLOAs(companyId, expired),
3234
retry: false,
3335
refetchOnMount: "always",
36+
enabled: featureFlags?.['LOA'] === 'ENABLED',
3437
refetchOnWindowFocus: false,
3538
});
3639
};

0 commit comments

Comments
 (0)