refactor: simplifier les actions du contrôleur en supprimant les contrôles ModelState redondants et en améliorant la récupération des données

This commit is contained in:
mirage
2026-04-02 15:57:52 +02:00
parent 6ccb8173ee
commit 8acafbfe49
16 changed files with 158 additions and 61 deletions

View File

@@ -133,8 +133,7 @@
<textarea name="Contenu"
rows="3"
class="form-control input-full"
placeholder="Votre commentaire..."
required></textarea>
placeholder="Votre commentaire..."></textarea>
</div>
</div>
@@ -156,7 +155,7 @@
<h4 class="mb-4">Commentaires</h4>
@if (Model.Details.Commentaires != null && Model.Details.Commentaires.Any())
@if (Model.Details.Commentaires.Any())
{
foreach (var comment in Model.Details.Commentaires.OrderByDescending(c => c.DateCreation))
{

View File

@@ -26,7 +26,7 @@
<div class="d-flex align-items-start my-3">
<!-- Image -->
<a asp-action="Details"
<a asp-action="Index"
asp-route-id="@titre.IdTitre"
class="me-3 text-black">
<img src="@titre.UrlJaquette" alt="@titre.Libelle" width="70px" height="70px" class="object-fit-cover" loading="lazy"/>
@@ -41,7 +41,7 @@
@titre.ArtisteNom
</a>
-
<a asp-action="Details"
<a asp-action="Index"
asp-route-id="@titre.IdTitre">
@titre.Libelle
</a>