Skip to content

Commit 828a8ad

Browse files
authored
Merge pull request #277 from navikt/fix-error-message-vedlegg
Vis riktig feilmelding vedlegg
2 parents 8ce5375 + 384f2c7 commit 828a8ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/routes/klageskjema/begrunnelse/attachments/upload-button.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ interface UploadError {
1111
timestamp: ISODateTime;
1212
status: number;
1313
error: string;
14-
message: string;
1514
path: string;
15+
detail: string;
1616
}
1717

1818
interface Props {
@@ -48,7 +48,7 @@ const UploadButton = ({ inputId, klage, attachments, setAttachments, setLoading,
4848
} catch (err) {
4949
if (err instanceof ApiError) {
5050
const errorBody: UploadError = await err.response.json();
51-
const errorMessage = getAttachmentErrorMessage(errorBody.message);
51+
const errorMessage = getAttachmentErrorMessage(errorBody.detail);
5252
setError(getUploadAttachmentErrorMessage(file, errorMessage));
5353
} else if (err instanceof Error) {
5454
setError(getUploadAttachmentErrorMessage(file, err.message));

0 commit comments

Comments
 (0)