end article start edit article
This commit is contained in:
@@ -63,6 +63,7 @@ public class ArticleController {
|
||||
UserProfil user = userService.utilisateurById(article.getUtilisateur());
|
||||
Categorie cate = categorieService.findCategorieById(article.getNumCategorie());
|
||||
Retrait retrait = retraitService.retraitByNumarticle(article.getId());
|
||||
article.setPseudoUtilisateur(user.getPseudo());
|
||||
List<Enchere> lastEnchere = this.enchereService.enchereByArticle(article.getId());
|
||||
Optional<Float> maxMontantEnchere = lastEnchere.stream()
|
||||
.map(Enchere::getMontantEnchere) // Récupère seulement les montants d'enchère
|
||||
@@ -72,7 +73,9 @@ public class ArticleController {
|
||||
model.addAttribute("cate", cate.getLibelle());
|
||||
model.addAttribute("retrait", retrait);
|
||||
model.addAttribute("enchere", new Enchere());
|
||||
model.addAttribute("maxEnchere", maxMontantEnchere.get());
|
||||
if (maxMontantEnchere.isPresent()) {
|
||||
model.addAttribute("maxEnchere", maxMontantEnchere.get());
|
||||
}
|
||||
List<ObjectError> errors = (List<ObjectError>) session.getAttribute("errors");
|
||||
if (errors != null) {
|
||||
model.addAttribute("errors", errors);
|
||||
|
||||
@@ -28,7 +28,7 @@ public class UserInterceptor implements HandlerInterceptor {
|
||||
if (authentication != null && authentication.isAuthenticated() && !authentication.getName().equals("anonymousUser")) {
|
||||
UserProfil user = this.userService.utilisateurByName(authentication.getName());
|
||||
if (modelAndView != null && modelAndView.getViewName() != null && !modelAndView.getViewName().startsWith("redirect:")) {
|
||||
modelAndView.addObject("user", user.getCredit());
|
||||
modelAndView.addObject("user", user);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user