Skip to content

Commit ee0b284

Browse files
author
stianStensli
committed
Bruk av proxy for decorator
1 parent 6d27ab3 commit ee0b284

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/components/internflate-decorator/internflate-decorator.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as React from 'react';
22
import NAVSPA from '@navikt/navspa';
33
import { DecoratorConfig } from './internflate-decorator-config';
4+
import { erGCP } from '../../rest/utils';
45

56
const Decorator: React.ComponentType<DecoratorConfig> = NAVSPA.importer<DecoratorConfig>('internarbeidsflatefs');
67

@@ -17,6 +18,7 @@ function lagDecoratorConfig(): DecoratorConfig {
1718
appname: 'Arbeidsrettet oppfølging',
1819
toggles: {
1920
visVeileder: true
20-
}
21+
},
22+
useProxy: erGCP()
2123
};
2224
}

src/rest/utils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ export interface FetchState<D = any> {
1515
httpCode: number;
1616
}
1717

18+
export function erGCP(): boolean {
19+
return window.location.hostname.endsWith('intern.nav.no');
20+
}
21+
1822
export const isAnyNotStartedOrPending = (fetch: FetchState | FetchState[]): boolean => {
1923
if (Array.isArray(fetch)) {
2024
return fetch.some(f => isNotStartedOrPending(f));

0 commit comments

Comments
 (0)