Skip to content

Commit

Permalink
FE: Disable fetch loa hook
Browse files Browse the repository at this point in the history
  • Loading branch information
krishnan-aot committed Dec 3, 2024
1 parent ea740d1 commit 589415b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions frontend/src/features/settings/hooks/LOA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
removeLOADocument,
updateLOA,
} from "../apiManager/loa";
import { useFeatureFlagsQuery } from "../../../common/hooks/hooks";

const QUERY_KEYS = {
LOAS: (expired: boolean) => ["loas", expired],
Expand All @@ -26,11 +27,13 @@ const QUERY_KEYS = {
* @returns Query result of the company's LOAs
*/
export const useFetchLOAs = (companyId: number | string, expired: boolean) => {
const {data: featureFlags} = useFeatureFlagsQuery();
return useQuery({
queryKey: QUERY_KEYS.LOAS(expired),
queryFn: () => getLOAs(companyId, expired),
retry: false,
refetchOnMount: "always",
enabled: featureFlags?.['LOA'] === 'ENABLED',
refetchOnWindowFocus: false,
});
};
Expand Down

0 comments on commit 589415b

Please sign in to comment.