Skip to content

Commit

Permalink
🐛 URL til uinnlogget mine-aap var feil
Browse files Browse the repository at this point in the history
Uinnlogget demo-søknad hadde feil lenke
til mine-aap
  • Loading branch information
steoiv committed Apr 10, 2024
1 parent cd08431 commit 4ca429e
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions components/pageComponents/standard/Kvittering/Kvittering.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import * as classes from './Kvittering.module.css';
import { KontaktInfoView, SøkerView } from 'context/sokerOppslagContext';
import { SuccessStroke } from '@navikt/ds-icons';
import { clientSideIsProd } from 'utils/environments';
import { clientSideIsProd, isFunctionalTest } from 'utils/environments';
import { FormattedMessage, useIntl } from 'react-intl';

interface StudentProps {
Expand All @@ -14,9 +14,16 @@ interface StudentProps {
const Kvittering = ({ søker, kontaktinformasjon }: StudentProps) => {
const { formatMessage } = useIntl();

const mineAapUrl = clientSideIsProd()
? 'https://nav.no/aap/mine-aap'
: 'https://aap-mine-aap.intern.dev.nav.no/aap/mine-aap';
const mineAapUrl = () => {
if (clientSideIsProd()) {
return 'https://nav.no/aap/mine-aap';
}
if (isFunctionalTest()) {
return process.env.NEXT_PUBLIC_MINE_AAP_URL;
}
return 'https://aap-mine-aap.intern.dev.nav.no/aap/mine-aap';
};

const dittNavUrl = clientSideIsProd()
? 'https://www.nav.no/person/dittnav/'
: 'https://www.dev.nav.no/person/dittnav/';
Expand Down Expand Up @@ -85,7 +92,7 @@ const Kvittering = ({ søker, kontaktinformasjon }: StudentProps) => {
</div>
)}
<form action={dittNavUrl}>
<Button as={'a'} variant={'primary'} href={mineAapUrl}>
<Button as={'a'} variant={'primary'} href={mineAapUrl()}>
{formatMessage({ id: 'søknad.kvittering.dittNavKnapp' })}
</Button>
</form>
Expand Down

0 comments on commit 4ca429e

Please sign in to comment.