setCredit on enchere
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user