Skip to content

Commit

Permalink
Use esyfo-proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
AudunSorheim committed Nov 9, 2023
1 parent f759b79 commit 772c229
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions nais/nais-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ spec:
value: "dev"
- name: AKTIVITETSKRAV_BACKEND_HOST
value: "http://aktivitetskrav-backend.team-esyfo"
- name: ESYFO_PROXY_API_URL
value: "https://www.intern.dev.nav.no/esyfo-proxy/api/aktivitetsplikt"
- name: AKTIVITETSKRAV_BACKEND_CLIENT_ID
value: "dev-gcp:team-esyfo:aktivitetskrav-backend"
- name: BASE_PATH
Expand Down
2 changes: 2 additions & 0 deletions nais/nais-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ spec:
value: "https://nav.no/dekoratoren"
- name: DECORATOR_ENV
value: "prod"
- name: ESYFO_PROXY_API_URL
value: "https://www.nav.no/esyfo-proxy/api/aktivitetsplikt"
- name: AKTIVITETSKRAV_BACKEND_HOST
value: "http://aktivitetskrav-backend.team-esyfo"
- name: AKTIVITETSKRAV_BACKEND_CLIENT_ID
Expand Down
7 changes: 5 additions & 2 deletions src/api/fetchAktivitetskrav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ import { AktivitetskravVurdering } from "@/schema/aktivitetskravVurderingSchema"
import fixtures from "@/mocks/fixtures";

export async function fetchAktivitetskrav() {
if (process.env.NEXT_PUBLIC_RUNTIME_ENVIRONMENT === "local") {
if (
process.env.NEXT_PUBLIC_RUNTIME_ENVIRONMENT === "local" ||
process.env.NEXT_PUBLIC_RUNTIME_ENVIRONMENT === "demo"
) {
return fixtures.unntakVurdering;
}

const res = await fetch("/api/aktivitetskrav");
const res = await fetch(process.env.ESYFO_PROXY_API_URL!);
const { data }: { data: AktivitetskravVurdering } = await res.json();
return data;
}

0 comments on commit 772c229

Please sign in to comment.