From 8a85187eac8b141dd761bd5a49fb32ab60e74f0a Mon Sep 17 00:00:00 2001 From: visoulier Date: Sun, 31 Mar 2024 19:36:39 +0200 Subject: [PATCH] fix error msg --- .../sciencequest/sae/controllers/PartieKahootController.java | 5 ++++- 1 file changed, 4 insertions(+), 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 a408db7..64bd8e3 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 @@ -144,9 +144,12 @@ public class PartieKahootController { partieKahoot = this.partieKahootService.maintenirAJourQuestionActuel(partieKahoot); Joueur joueur = this.joueurService.findById(request.getIdJoueur()); - if(partieKahoot.getStatus() != Status.Started){ + if(partieKahoot.getStatus() == Status.Pending){ throw new PartyNotStartedException(); } + if(partieKahoot.getStatus() == Status.Ended){ + throw new PartyIsEndedException(); + } if(partieKahoot.getJoueurs().stream().noneMatch(joueur1 -> Objects.equals(joueur1.getId(), joueur.getId()))){ throw new JoueurPasDansPartieException();