Merge branch 'dev' into j3/TODO_erreurs

This commit is contained in:
josephine.vetu
2026-04-01 17:41:27 +02:00
26 changed files with 281 additions and 74 deletions

View File

@@ -7,6 +7,37 @@ public static class RouteConfiguration
/// </summary>
public static void MapCustomRoutes(this IEndpointRouteBuilder endpoints)
{
// ----------- TITRE -----------
endpoints.MapControllerRoute(
name: "TitreStyle",
pattern: "titres/style/{style}",
defaults: new { controller = "Titre", action = "Style" });
endpoints.MapControllerRoute(
name: "TitreIndex",
pattern: "titre/{id}",
defaults: new { controller = "Titre", action = "Index" });
endpoints.MapControllerRoute(
name: "ArtisteIndex",
pattern: "artiste/{nom}",
defaults: new { controller = "Artiste", action = "Index" });
// ----------- ADMIN -----------
var adminRoutes = new Dictionary<string, string>
{
{ "artistes", "Artiste" }, { "commentaires", "Commentaire" }, { "styles", "Style" }, { "titres", "Titre" },
};
foreach (var route in adminRoutes)
{
endpoints.MapControllerRoute(
name: $"Admin{route.Value}Index",
pattern: $"administration/{route.Key}",
defaults: new { area = "Administration", controller = route.Value, action = "Index" });
}
// --- AUTRE PROUTES ---
endpoints.MapControllerRoute(
name: "areas",
pattern: "{area:exists}/{controller=Home}/{action=Index}/{id?}");