Skip to content

Commit f9cb366

Browse files
committed
remove force-dynamic its not necessary anymore after moving call to getEnv() after call to headers(). Now next sees that the route is dynamic and stops rendering the route before the call to getEnv().
1 parent fec5593 commit f9cb366

File tree

4 files changed

+4
-16
lines changed

4 files changed

+4
-16
lines changed

.env.development.local

Lines changed: 0 additions & 11 deletions
This file was deleted.

.env.local

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NEXT_PUBLIC_RUNTIME_ENVIRONMENT=local

src/app/page.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { fetchKandidatStatus } from '@/services/meroppfolging/meroppfolgingService'
22
import KartleggingssporsmalLanding from '@/features/kartleggingssporsmal/KartleggingssporsmalLanding'
33

4-
export const dynamic = 'force-dynamic'
5-
64
export default async function Home() {
75
const kandidatStatus = await fetchKandidatStatus()
86

src/services/meroppfolging/meroppfolgingService.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ export async function fetchKandidatStatus(): Promise<KandidatStatusResponse> {
1818
}
1919
}
2020

21-
const { MEROPPFOLGING_BACKEND_URL } = getServerEnv()
22-
const url = new URL('/api/v1/kartleggingssporsmal/kandidat-status', MEROPPFOLGING_BACKEND_URL)
23-
2421
const idportenToken = await verifyUserLoggedIn()
2522
const exchangedToken = await exchangeIdportenTokenForMeroppfolgingBackendTokenx(idportenToken)
2623

24+
const { MEROPPFOLGING_BACKEND_URL } = getServerEnv()
25+
const url = new URL('/api/v1/kartleggingssporsmal/kandidat-status', MEROPPFOLGING_BACKEND_URL)
26+
2727
try {
2828
const res = await fetch(url, {
2929
method: 'GET',

0 commit comments

Comments
 (0)