Skip to content

Commit

Permalink
Merge pull request #159 from abes-esr/fix_destructuration_idAbes
Browse files Browse the repository at this point in the history
fix: 🐛 remplacement du foreach par un stream map
  • Loading branch information
willdonn-abes authored Jan 8, 2025
2 parents 52a46c2 + f57d8a1 commit 5bb5840
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,16 @@ public boolean existeMail(String email) {

public List<EtablissementEntity> findAll() {
List<EtablissementEntity> list = etablissementDao.findAll();
list.forEach(etab -> {
etab.setIdAbes(GenererIdAbes.genererIdAbes(etab.getIdAbes()));
});
return list;
return list.stream().map(e ->
new EtablissementEntity(
e.getId(),
e.getNom(),
e.getSiren(),
e.getTypeEtablissement(),
GenererIdAbes.genererIdAbes(e.getIdAbes()),
e.getContact()
)
).collect(Collectors.toList());
}

public EtablissementEntity getUserByMail(String mail) {
Expand Down

0 comments on commit 5bb5840

Please sign in to comment.