diff --git a/src/main/java/fr/eni/enchere/controllers/EnchereController.java b/src/main/java/fr/eni/enchere/controllers/EnchereController.java
index 48066c4..f086a83 100644
--- a/src/main/java/fr/eni/enchere/controllers/EnchereController.java
+++ b/src/main/java/fr/eni/enchere/controllers/EnchereController.java
@@ -67,11 +67,14 @@ public class EnchereController {
}
if (result.hasErrors()) {
+ System.out.println(result);
session.setAttribute("errors", result.getAllErrors());
return "redirect:/article/show?id=" + articleId;
}
this.enchereService.setEnchere(enchere);
+ float newCredit = userCredit - enchere.getMontantEnchere();
+ this.userService.setCredit(newCredit, this.userService.utilisateurByName(authentication.getName()).getId());
return "redirect:/article/show?id=" + articleId;
}
diff --git a/src/main/resources/templates/article.html b/src/main/resources/templates/article.html
index 088256d..d1cde8e 100644
--- a/src/main/resources/templates/article.html
+++ b/src/main/resources/templates/article.html
@@ -55,11 +55,11 @@
-
-
-
-
-
+
+
+
+
+