#146 Ajout de ModelState.IsValid pour les formulaires et opérations de suppression/edition.

This commit is contained in:
josephine.vetu
2026-04-01 17:01:00 +02:00
parent afc9f1bdb4
commit e7b327a2ed
2 changed files with 14 additions and 0 deletions

View File

@@ -154,6 +154,12 @@ public class TitreController : Controller
public IActionResult Delete(AdminTitreDelete model)
{
var titre = this.titreRepository.Find(model.Id);
if (!this.ModelState.IsValid)
{
return this.View(model);
}
if (titre != null)
{
this.titreRepository.Delete(titre);