Skip to content

Commit

Permalink
🔥 Fjerner mer kode relatert til søknad-api
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbjoern authored Mar 13, 2024
2 parents d1f1645 + 5f2d52b commit 6106595
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 330 deletions.
5 changes: 0 additions & 5 deletions pages/[step].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import { beskyttetSide } from 'auth/beskyttetSide';
import { GetServerSidePropsResult, NextPageContext } from 'next';
import { getAccessToken } from 'auth/accessToken';
import { getSøker } from './api/oppslag/soeker';
import { lesBucket } from './api/buckets/les';
import { logSkjemaFullførtEvent, logVeiledningVistEvent } from 'utils/amplitude';
import metrics from 'utils/metrics';
import { scrollRefIntoView } from 'utils/dom';
Expand Down Expand Up @@ -146,10 +145,6 @@ const Steps = ({ søker, mellomlagretSøknad, kontaktinformasjon, barn }: PagePr
}
return false;
};
const postSøknadMedSoknadApi = async (data?: any) =>
fetchPOST('/aap/soknad/api/innsending/soknadapi', {
...data,
});

const postSøknadMedAAPInnsending = async (søknad?: Soknad, requiredVedlegg?: RequiredVedlegg[]) =>
fetchPOST('/aap/soknad/api/innsending/soknadinnsending/', {
Expand Down
56 changes: 0 additions & 56 deletions pages/api/buckets/lagre.ts

This file was deleted.

61 changes: 0 additions & 61 deletions pages/api/buckets/les.ts

This file was deleted.

40 changes: 0 additions & 40 deletions pages/api/buckets/slett.ts

This file was deleted.

47 changes: 0 additions & 47 deletions pages/api/innsending/soknadapi.ts

This file was deleted.

2 changes: 0 additions & 2 deletions pages/api/innsending/soknadinnsending.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { NextApiRequest, NextApiResponse } from 'next';
import metrics from 'utils/metrics';
import { ErrorMedStatus } from 'auth/ErrorMedStatus';
import { isFunctionalTest, isMock } from 'utils/environments';
import { slettBucket } from 'pages/api/buckets/slett';
import { createIntl } from 'react-intl';
import { flattenMessages, messages } from 'utils/message';
import links from 'translations/links.json';
Expand Down Expand Up @@ -152,7 +151,6 @@ export const sendSoknadViaAapInnsending = async (
return 'Vi har mottat søknaden din.';
}
if (isMock()) {
await slettBucket('STANDARD', accessToken);
return 'Vi har mottat søknaden din.';
}
const søknad = await tokenXApiProxy({
Expand Down
33 changes: 0 additions & 33 deletions pages/api/vedlegg/lagre.ts

This file was deleted.

21 changes: 0 additions & 21 deletions pages/api/vedlegg/les.ts

This file was deleted.

40 changes: 0 additions & 40 deletions pages/api/vedlegg/slett.ts

This file was deleted.

1 change: 0 additions & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { GetServerSidePropsResult, NextPageContext } from 'next/types';
import { beskyttetSide } from 'auth/beskyttetSide';
import { getAccessToken } from 'auth/accessToken';
import { fetchPOST } from 'api/fetch';
import { lesBucket } from 'pages/api/buckets/les';
import { StepType } from 'components/StepWizard/Step';
import { logSkjemaStartetEvent } from 'utils/amplitude';
import metrics from 'utils/metrics';
Expand Down
33 changes: 9 additions & 24 deletions pages/vedlegg/[uuid].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,15 @@ const Vedlegg = ({}: PageProps) => {

useEffect(() => {
const getFile = async () => {
const [fileFromSoknadApi, fileFromInnsending] = await Promise.all([
fetch(`/aap/soknad/api/vedlegg/les/?uuid=${uuid}`)
.then((res) => {
if (res.ok) {
return res.blob();
}
return undefined;
})
.catch(() => undefined),
fetch(`/aap/soknad/api/vedlegginnsending/les/?uuid=${uuid}`)
.then((res) => {
if (res.ok) {
return res.blob();
}
return undefined;
})
.catch(() => undefined),
]);

if (fileFromInnsending) {
setFile(fileFromInnsending);
} else if (fileFromSoknadApi) {
setFile(fileFromSoknadApi);
}
const fileFromInnsending = await fetch(`/aap/soknad/api/vedlegginnsending/les/?uuid=${uuid}`)
.then((res) => {
if (res.ok) {
return res.blob();
}
return undefined;
})
.catch(() => undefined);
setFile(fileFromInnsending);
};

getFile();
Expand Down

0 comments on commit 6106595

Please sign in to comment.