From fd688a10f72018b4f258b4f7f3ce46d31c91162d Mon Sep 17 00:00:00 2001 From: visoulier Date: Tue, 2 Apr 2024 17:41:07 +0200 Subject: [PATCH] fix contains --- .../sciencequest/sae/controllers/PartieKahootController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SpringBootProject/src/main/java/fr/iut/sciencequest/sae/controllers/PartieKahootController.java b/SpringBootProject/src/main/java/fr/iut/sciencequest/sae/controllers/PartieKahootController.java index f7107b5..88e8ebb 100644 --- a/SpringBootProject/src/main/java/fr/iut/sciencequest/sae/controllers/PartieKahootController.java +++ b/SpringBootProject/src/main/java/fr/iut/sciencequest/sae/controllers/PartieKahootController.java @@ -89,7 +89,7 @@ public class PartieKahootController { Joueur joueur = this.joueurService.findById(request.getIdJoueur()); PartieKahoot partie = this.partieKahootService.getPartieKahootByIdOrCodeInvitation(codeInvitation); if(!partie.getStatus().equals(Status.Pending)) throw new PartyAlreadyStartedException(); - if(!partie.getJoueurs().contains(joueur)){ + if(!partie.getJoueurs().stream().anyMatch(j -> j.getId() == joueur.getId())){ ScorePartieKahootJoueur score = new ScorePartieKahootJoueur(); score.setId(new ScorePartieKahootJoueurKey(joueur.getId(), partie.getId())); score.setJoueur(joueur);