Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

La til mapping for nye felter for høy grind #54

Merged
merged 2 commits into from
Oct 3, 2023
Merged

La til mapping for nye felter for høy grind #54

merged 2 commits into from
Oct 3, 2023

Conversation

hakhag
Copy link
Contributor

@hakhag hakhag commented Oct 3, 2023

No description provided.

@hakhag hakhag requested a review from a team as a code owner October 3, 2023 08:30
@@ -454,7 +455,15 @@ private fun sengeInfo(hjelpemiddel: JsonNode): SengeInfo? {
"HarFraFor" -> MadrassValg.HarFraFor
null -> null
else -> throw RuntimeException("Ugyldig sitteputeValg")
}
},
høyGrindValg = if (høyGrindValg != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Her trur eg vi kan forenkle med treeToValue. Tilsvarande som for oppreisingstol (linje 308):

private fun oppreisningsStolInfo(hjelpemiddel: JsonNode): OppreisningsStolInfo? {
    val oppreisningsStolInfo = hjelpemiddel["oppreisningsStolInfo"] ?: return null
    return objectMapper.treeToValue<OppreisningsStolInfo>(oppreisningsStolInfo)
}

Så noko sånnt som dette:

høyGrindValg = høyGrindValg?.let{ objectMapper.treeToValue<HøyGrindValg>(it) }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch 🥇 Har fikset det nå.

@hakhag hakhag merged commit 29666e0 into main Oct 3, 2023
2 checks passed
@hakhag hakhag deleted the høyGrindValg branch October 3, 2023 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants