diff --git a/src/app/personside/Personoversikt.tsx b/src/app/personside/Personoversikt.tsx
index 8c1b064c3..def2c8a07 100644
--- a/src/app/personside/Personoversikt.tsx
+++ b/src/app/personside/Personoversikt.tsx
@@ -22,7 +22,7 @@ function Personoversikt() {
}
});
- return tilgangskontroll.useRenderer((data) => {
+ return tilgangskontroll.useRenderer(fnr, (data) => {
if (!data.harTilgang) {
return ;
}
diff --git a/src/rest/resources/tilgangskontrollResource.tsx b/src/rest/resources/tilgangskontrollResource.tsx
index 2acdf1e1f..900997044 100644
--- a/src/rest/resources/tilgangskontrollResource.tsx
+++ b/src/rest/resources/tilgangskontrollResource.tsx
@@ -4,7 +4,6 @@ import AlertStripe from 'nav-frontend-alertstriper';
import { apiBaseUri } from '../../api/config';
import { BigCenteredLazySpinner } from '../../components/BigCenteredLazySpinner';
import FillCenterAndFadeIn from '../../components/FillCenterAndFadeIn';
-import { useGjeldendeBruker } from '../../redux/gjeldendeBruker/types';
import { useQuery, UseQueryResult } from '@tanstack/react-query';
import { FetchError, get, post } from '../../api/api';
import { useValgtenhet } from '../../context/valgtenhet-state';
@@ -57,14 +56,13 @@ function urlV2(enhet: string | undefined) {
}
const resource = {
- useFetch(): UseQueryResult {
- const fnr = useGjeldendeBruker();
+ useFetch(fnr: string): UseQueryResult {
const enhet = useValgtenhet().enhetId;
const { isOn } = useFeatureToggle(FeatureToggles.IkkeFnrIPath);
return useQuery(queryKey(fnr), () => (isOn ? post(urlV2(enhet), { fnr }) : get(url(fnr, enhet))));
},
- useRenderer(renderer: RendererOrConfig) {
- const response = this.useFetch();
+ useRenderer(fnr: string, renderer: RendererOrConfig) {
+ const response = this.useFetch(fnr);
return useRest(response, applyDefaults(defaults, renderer));
}
};