Skip to content

Commit

Permalink
Midlertidig build-time override av url til draft
Browse files Browse the repository at this point in the history
  • Loading branch information
LudvigHz committed May 3, 2024
1 parent 8590898 commit 3bc71ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions src/app/personside/dialogpanel/use-draft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
}
};
Expand Down

0 comments on commit 3bc71ca

Please sign in to comment.