Skip to content

Commit

Permalink
Ikke bruk tomt søskenarray men opprett fra grunnlagsdata (#6159)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebassonav authored Oct 30, 2024
1 parent 9198b86 commit 9cf5033
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const Soeskenjustering = (props: SoeskenjusteringProps) => {
soeskenMedIBeregning: PeriodisertBeregningsgrunnlag<SoeskenKanskjeMedIBeregning[]>[]
}>({
defaultValues: {
soeskenMedIBeregning: behandling.beregningsGrunnlag?.soeskenMedIBeregning
soeskenMedIBeregning: !!behandling.beregningsGrunnlag?.soeskenMedIBeregning.length
? mapListeFraDto(behandling.beregningsGrunnlag?.soeskenMedIBeregning)
: [nySoeskengrunnlagPeriode(soesken, behandling.virkningstidspunkt?.dato)],
},
Expand All @@ -91,7 +91,7 @@ const Soeskenjustering = (props: SoeskenjusteringProps) => {
})

const innloggetSaksbehandler = useInnloggetSaksbehandler()
const behandles = behandlingErRedigerbar(
const redigerbar = behandlingErRedigerbar(
behandling.status,
behandling.sakEnhetId,
innloggetSaksbehandler.skriveEnheter
Expand Down Expand Up @@ -185,7 +185,7 @@ const Soeskenjustering = (props: SoeskenjusteringProps) => {
)}
</FamilieforholdWrapper>
<Box borderWidth="1 0 0 0" borderColor="border-subtle">
{visFeil && feil.length > 0 && behandles ? <FeilIPerioder feil={feil} /> : null}
{visFeil && feil.length > 0 && redigerbar ? <FeilIPerioder feil={feil} /> : null}
<form id="formsoeskenjustering">
<UstiletListe>
{fields.map((item, index) => (
Expand All @@ -208,7 +208,7 @@ const Soeskenjustering = (props: SoeskenjusteringProps) => {
/>
))}
</UstiletListe>
{behandles && (
{redigerbar && (
<HStack gap="4" align="center">
<Button
size="small"
Expand Down

0 comments on commit 9cf5033

Please sign in to comment.