diff --git a/src/demo/setup-demo-mock.ts b/src/demo/setup-demo-mock.ts index 57d2a143..bde2bdd9 100644 --- a/src/demo/setup-demo-mock.ts +++ b/src/demo/setup-demo-mock.ts @@ -22,6 +22,7 @@ import { DAGPENGER_STATUS, ANTATT_INAKTIVERINGSGRUNN, REAKTIVERING_URL, + FULLFOER_REAKTIVERING_URL, } from '../ducks/api'; import { @@ -174,6 +175,9 @@ export const demo_handlers = [ rest.get(REAKTIVERING_URL, reaktiveringGetResolver), rest.post(REAKTIVERING_URL, reaktiveringPostResolver), + rest.post(FULLFOER_REAKTIVERING_URL, (req, res, ctx) => { + return res(ctx.status(200)); + }), rest.post('https://amplitude.nav.no/collect', (req, res, ctx) => { return res(ctx.status(200)); diff --git a/src/ducks/api.ts b/src/ducks/api.ts index 4dd82d3d..6b6e0a0b 100644 --- a/src/ducks/api.ts +++ b/src/ducks/api.ts @@ -62,4 +62,5 @@ export const AIA_BACKEND = aiaBackendUrl, BEHOV_FOR_VEILEDNING_URL = `${AIA_BACKEND}/behov-for-veiledning`, DAGPENGER_STATUS = `${AIA_BACKEND}/dagpenger-status`, ANTATT_INAKTIVERINGSGRUNN = `${AIA_BACKEND}/data/meldekort-inaktivering`, - REAKTIVERING_URL = `${AIA_BACKEND}/reaktivering`; + REAKTIVERING_URL = `${AIA_BACKEND}/reaktivering`, + FULLFOER_REAKTIVERING_URL = `${AIA_BACKEND}/fullfoerreaktivering`; diff --git a/src/komponenter/reaktivering/reaktivering-aktuelt.tsx b/src/komponenter/reaktivering/reaktivering-aktuelt.tsx index c140e202..6e031a79 100644 --- a/src/komponenter/reaktivering/reaktivering-aktuelt.tsx +++ b/src/komponenter/reaktivering/reaktivering-aktuelt.tsx @@ -7,11 +7,13 @@ import { useMeldeplikt } from '../../contexts/meldeplikt'; import ErRendret from '../er-rendret/er-rendret'; import InViewport from '../in-viewport/in-viewport'; import { loggAktivitet } from '../../metrics/metrics'; -import { dialogLenke, reaktiveringLenke } from '../../innhold/lenker'; +import { dialogLenke } from '../../innhold/lenker'; import SisteMeldekortVidereRegistrertValg from './siste-meldekort-videre-registrert-valg'; import styles from '../../innhold/innhold.module.css'; import spacingStyles from '../../spacing.module.css'; +import { fetchToJson } from '../../ducks/api-utils'; +import { FULLFOER_REAKTIVERING_URL, requestConfig } from '../../ducks/api'; interface Props { handleIkkeReaktivering: (event: React.SyntheticEvent) => void; @@ -23,16 +25,17 @@ const ReaktiveringAktuelt = (props: Props) => { const { handleIkkeReaktivering } = props; - const handleReaktivering = (aktivitet: string) => { - loggAktivitet({ aktivitet: aktivitet, ...amplitudeData }); - window.location.assign(reaktiveringLenke); - }; - const handleDialog = (aktivitet: string) => { loggAktivitet({ aktivitet: aktivitet, ...amplitudeData }); window.location.assign(dialogLenke); }; + const fullfoerReaktivering = async () => + await fetchToJson(FULLFOER_REAKTIVERING_URL, { + ...requestConfig(), + method: 'POST', + }); + return (
@@ -43,7 +46,7 @@ const ReaktiveringAktuelt = (props: Props) => {
-