Skip to content

Commit

Permalink
knoter
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbjoern committed Dec 6, 2023
1 parent 9798038 commit d560586
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions components/fileupload/FileUpload.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Ettersendelse, VedleggType } from 'lib/types/types';
import { InnsendingBackendState, VedleggType } from 'lib/types/types';
import { FileInput, Vedlegg } from '@navikt/aap-felles-react';
import { Section } from 'components/Section/Section';
import { Alert, BodyShort, Button, Heading } from '@navikt/ds-react';
Expand Down Expand Up @@ -41,15 +41,13 @@ export const FileUpload = ({ søknadId, krav, addError, deleteError, onSuccess,
return;
}

const ettersendelse: Ettersendelse = {
const ettersendelse: InnsendingBackendState = {
...(søknadId && { søknadId: søknadId }),
totalFileSize: files.reduce((acc, curr) => acc + curr.size, 0),
ettersendteVedlegg: [
{
vedleggType: krav,
ettersending: files.map((file) => file.vedleggId),
},
],

filer: files.map((file) => ({
tittel: file.name,
id: file.vedleggId,
})),
};

try {
Expand Down

0 comments on commit d560586

Please sign in to comment.