#162 : Patch bug lors de retour sur une page "Delete" après la suppression d'un élément. Redirection sur la page "Index" en cas de retour en arrière de la part d'un utilisateur.

This commit is contained in:
Loic Masi
2026-03-31 16:48:40 +02:00
parent 0039bb981e
commit bf4b12997c
5 changed files with 18 additions and 4 deletions

View File

@@ -87,6 +87,12 @@ public class ArtisteController : Controller
public IActionResult Delete(int id)
{
var artiste = this.artisteRepository.Find(id);
if (artiste == null)
{
return this.RedirectToAction("Index");
}
var model = new AdminArtisteForm
{
Id = id,

View File

@@ -53,6 +53,11 @@ namespace Webzine.WebApplication.Areas.Administration.Controllers
{
var commentaire = this.commentaireRepository.Find(id);
if (commentaire == null)
{
return this.RedirectToAction("Index");
}
var model = new CommentaireDeleteViewModel
{
IdCommentaire = commentaire.IdCommentaire,

View File

@@ -130,6 +130,11 @@ public class TitreController : Controller
{
var titre = this.titreRepository.Find(id);
if (titre == null)
{
return this.RedirectToAction("Index");
}
var model = new AdminTitreDelete
{
Id = titre.IdTitre,