From 7d1eec44fe1ca2129d141d45a0c09b99aa2991fa Mon Sep 17 00:00:00 2001 From: kristenhaerum Date: Mon, 9 Sep 2024 10:54:25 +0200 Subject: [PATCH] Refactor getFoedested and getFoedselsdato functions Remove unnecessary `utenHistorikk` method call from `getFoedested` and `getFoedselsdato` functions. This streamlines the logic by directly returning the mapped list when relevant data is unavailable. --- .../no/nav/pdl/forvalter/service/PdlOrdreService.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/service/PdlOrdreService.java b/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/service/PdlOrdreService.java index 7efc16838a6..0bc873f7c99 100644 --- a/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/service/PdlOrdreService.java +++ b/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/service/PdlOrdreService.java @@ -388,15 +388,15 @@ private List utenHistorikk(List private List getFoedested(PersonDTO person) { - return utenHistorikk(!person.getFoedested().isEmpty() ? + return !person.getFoedested().isEmpty() ? person.getFoedested() : - mapperFacade.mapAsList(person.getFoedsel(), FoedestedDTO.class)); + mapperFacade.mapAsList(person.getFoedsel(), FoedestedDTO.class); } private List getFoedselsdato(PersonDTO person) { - return utenHistorikk(!person.getFoedselsdato().isEmpty() ? + return !person.getFoedselsdato().isEmpty() ? person.getFoedselsdato() : - mapperFacade.mapAsList(person.getFoedsel(), FoedselDTO.class)); + mapperFacade.mapAsList(person.getFoedsel(), FoedselDTO.class); } } \ No newline at end of file