Skip to content

Commit c97b163

Browse files
committed
proxy oppsett
1 parent cf92ec2 commit c97b163

File tree

12 files changed

+52
-0
lines changed

12 files changed

+52
-0
lines changed

apps/dolly-frontend/config.idporten.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ spec:
5252
- application: testnorge-profil-api
5353
- application: testnorge-tilbakemelding-api
5454
- application: testnav-yrkesskade-proxy
55+
- application: testnav-nom-proxy
5556
- application: testnav-altinn3-tilgang-proxy
5657
- application: testnav-arbeidssoekerregisteret-proxy
5758
- application: testnav-api-oversikt-service

apps/dolly-frontend/config.test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ spec:
5959
- application: testnav-levende-arbeidsforhold-scheduler
6060
- application: testnav-skattekort-service
6161
- application: testnav-yrkesskade-proxy
62+
- application: testnav-nom-proxy
6263
- application: testnav-altinn3-tilgang-service
6364
- application: testnav-arbeidssoekerregisteret-proxy
6465
- application: testnav-api-oversikt-service

apps/dolly-frontend/config.unstable.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ spec:
4949
- application: testnorge-tilbakemelding-api
5050
- application: testnav-skattekort-service
5151
- application: testnav-yrkesskade-proxy
52+
- application: testnav-nom-proxy
5253
- application: testnav-altinn3-tilgang-service
5354
- application: testnav-arbeidssoekerregisteret-proxy
5455
- application: testnav-api-oversikt-service

apps/dolly-frontend/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ spec:
6060
- application: testnav-levende-arbeidsforhold-ansettelse
6161
- application: testnav-levende-arbeidsforhold-scheduler
6262
- application: testnav-yrkesskade-proxy
63+
- application: testnav-nom-proxy
6364
- application: testnav-altinn3-tilgang-proxy
6465
- application: testnav-arbeidssoekerregisteret-proxy
6566
- application: testnav-api-oversikt-service

apps/dolly-frontend/src/main/java/no/nav/dolly/web/DollyFrontendApplicationStarter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public RouteLocator customRouteLocator(RouteLocatorBuilder builder) {
9696
.route(createRoute(consumers.getTestnavLevendeArbeidsforholdAnsettelse(), "testnav-levende-arbeidsforhold-ansettelse"))
9797
.route(createRoute(consumers.getTestnavLevendeArbeidsforholdScheduler(), "testnav-levende-arbeidsforhold-scheduler"))
9898
.route(createRoute(consumers.getTestnavYrkesskadeProxy()))
99+
.route(createRoute(consumers.getTestnavNomProxy()))
99100
.route(createRoute(consumers.getTestnavAltinn3TilgangService(), "testnav-altinn3-tilgang-service"))
100101
.route(createRoute(consumers.getTestnavArbeidssoekerregisteretProxy()))
101102
.route(createRoute(consumers.getTestnavApiOversiktService(), "testnav-oversikt-service"))

apps/dolly-frontend/src/main/java/no/nav/dolly/web/config/Consumers.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public class Consumers {
6666
private ServerProperties testnavLevendeArbeidsforholdAnsettelse;
6767
private ServerProperties testnavLevendeArbeidsforholdScheduler;
6868
private ServerProperties testnavYrkesskadeProxy;
69+
private ServerProperties testnavNomProxy;
6970
private ServerProperties testnavAltinn3TilgangService;
7071
private ServerProperties testnavArbeidssoekerregisteretProxy;
7172
private ServerProperties testnavApiOversiktService;

apps/dolly-frontend/src/main/js/proxy-routes.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,5 +167,8 @@
167167
},
168168
"/testnav-oversikt-service/api": {
169169
"changeOrigin": true
170+
},
171+
"/testnav-nom-proxy": {
172+
"changeOrigin": true
170173
}
171174
}

apps/dolly-frontend/src/main/js/src/api/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ type Config = {
173173
const _fetch = (url: string, config: Config, body?: object): Promise<Response> =>
174174
fetchRetry(url, {
175175
retryOn: (attempt, error, response) => {
176+
console.log('response: ', response) //TODO - SLETT MEG
176177
if (
177178
!response?.ok &&
178179
response?.status !== 404 &&

apps/dolly-frontend/src/main/js/src/pages/gruppe/PersonVisning/PersonVisning.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ import { useArbeidssoekerregistrering } from '@/utils/hooks/useArbeidssoekerregi
113113
import { ArbeidssoekerregisteretVisning } from '@/components/fagsystem/arbeidssoekerregisteret/visning/ArbeidssoekerregisteretVisning'
114114
import { usePensjonsgivendeInntekt, useSummertSkattegrunnlag } from '@/utils/hooks/useSigrunstub'
115115
import { SigrunstubSummertSkattegrunnlagVisning } from '@/components/fagsystem/sigrunstubSummertSkattegrunnlag/visning/Visning'
116+
import { useNomData } from '@/utils/hooks/useNom'
116117

117118
const getIdenttype = (ident) => {
118119
if (parseInt(ident.charAt(0)) > 3) {
@@ -296,6 +297,9 @@ export default ({
296297
ident?.master === 'PDL' ? ident.ident : null,
297298
)
298299

300+
const { nomData, loading: loadingNom } = useNomData(ident.ident)
301+
console.log('nomData: ', nomData) //TODO - SLETT MEG
302+
299303
const getGruppeIdenter = () => {
300304
return useAsync(async () => DollyApi.getGruppeById(gruppeId), [DollyApi.getGruppeById])
301305
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import useSWR from 'swr'
2+
import api, { fetcher } from '@/api'
3+
4+
const baseUrl = '/testnav-nom-proxy'
5+
6+
export const useNomData = (ident: any) => {
7+
const { data, isLoading, error } = useSWR<any, Error>(
8+
ident ? `${baseUrl}/api/v1/dolly/hentRessurs` : null,
9+
// (url) => fetcher(url, { method: 'POST', params: { ident } }),
10+
(url) => {
11+
return api
12+
.fetchJson(
13+
url,
14+
{
15+
method: 'POST',
16+
headers: {
17+
'Content-Type': 'application/json',
18+
},
19+
},
20+
ident,
21+
)
22+
.then((response: any) => ({ data: response }))
23+
},
24+
)
25+
26+
return {
27+
nomData: data,
28+
loading: isLoading,
29+
error: error,
30+
}
31+
}

0 commit comments

Comments
 (0)