From 3bc71cad0ea1884c409eef2f530ce253386f5ddb Mon Sep 17 00:00:00 2001 From: Ludvig Hozman Date: Thu, 2 May 2024 12:50:31 +0200 Subject: [PATCH] Midlertidig build-time override av url til draft --- .env.production | 2 ++ src/app/personside/dialogpanel/use-draft.ts | 3 +++ 2 files changed, 5 insertions(+) diff --git a/.env.production b/.env.production index b1d6582314..f094474274 100644 --- a/.env.production +++ b/.env.production @@ -5,3 +5,5 @@ VITE_HODE_URL_V2=https://cdn.nav.no/personoversikt/internarbeidsflate-decorator- SKIP_PREFLIGHT_CHECK=true VITE_AMPLITUDE_API_KEY=4b7349a378cfc18faf21e1fe6bea0cf2 VITE_AMPLITUDE_API_KEY_DEV=716ce898b7143ffd7ff3e52dfe69bae7 + +VITE_DRAFT_URL=modiapersonoversikt-draft.intern.dev.nav.no/modiapersonoversikt-draft diff --git a/src/app/personside/dialogpanel/use-draft.ts b/src/app/personside/dialogpanel/use-draft.ts index cf32055069..0d1f6f6f80 100644 --- a/src/app/personside/dialogpanel/use-draft.ts +++ b/src/app/personside/dialogpanel/use-draft.ts @@ -39,6 +39,9 @@ function useDraft(context: DraftContext, ifPresent: (draft: Draft) => void = () } else { const uuid: string = await response.json(); const loc = window.location; + if (import.meta.env.VITE_DRAFT_URL) { + return `wss://${import.meta.env.VITE_DRAFT_URL}/api/draft/ws/${uuid}`; + } return `wss://${loc.host}/modiapersonoversikt-draft/api/draft/ws/${uuid}`; } };