Skip to content

Commit

Permalink
sender med tomme verdier for brødtekst og overskrift for å trigge rik…
Browse files Browse the repository at this point in the history
…tig valideringstekst fra backend. Kan ikke sende null i disse feltene fordi parsing i backend krever at de feltene er satt. (#5502)
  • Loading branch information
qtips authored Jan 4, 2024
1 parent 564d42d commit 3e2ec68
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/sak-app/src/behandlingsupport/melding/MeldingIndex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import BehandlingType, { erTilbakekrevingType } from '@fpsak-frontend/kodeverk/s
import dokumentMalType from '@fpsak-frontend/kodeverk/src/dokumentMalType';
import venteArsakType from '@fpsak-frontend/kodeverk/src/venteArsakType';
import kodeverkTyper from '@fpsak-frontend/kodeverk/src/kodeverkTyper';
import MeldingerSakIndex, { FormValues, MessagesModalSakIndex, type MeldingerSakIndexBackendApi } from '@k9-sak-web/sak-meldinger';
import MeldingerSakIndex, {
FormValues,
MessagesModalSakIndex,
type MeldingerSakIndexBackendApi,
} from '@k9-sak-web/sak-meldinger';
import { LoadingPanel } from '@fpsak-frontend/shared-components';
import { RestApiState } from '@k9-sak-web/rest-api-hooks';
import {
Expand Down Expand Up @@ -84,8 +88,9 @@ const getPreviewCallback =
dokumentMal,
dokumentdata: {
fritekst: fritekst || ' ',
fritekstbrev:
fritekstbrev && Object.values(fritekstbrev).some(x => x === null || x === '') ? null : fritekstbrev,
fritekstbrev: fritekstbrev
? { brødtekst: fritekstbrev.brødtekst ?? '', overskrift: fritekstbrev.overskrift ?? '' }
: null,
},
};
fetchPreview(false, data);
Expand Down

0 comments on commit 3e2ec68

Please sign in to comment.