#152 refacto route titre:

- suppression des routes dans controller route
- gestion du routage dans RouteConfig
This commit is contained in:
b.nodon
2026-03-31 15:16:54 +02:00
parent 7b330fcaec
commit 92d340caa2
2 changed files with 36 additions and 10 deletions

View File

@@ -7,26 +7,55 @@ public static class RouteConfiguration
/// </summary>
public static void MapCustomRoutes(this IEndpointRouteBuilder endpoints)
{
// --- ARTISTES ---
// --- DETAILS D'UN TITRE ---
// exemple : /titre/5
endpoints.MapControllerRoute(
name: "TitreDetails",
pattern: "titre/{id}",
defaults: new { controller = "Titre", action = "Details" });
// --- TITRES PAR STYLE ---
// exemple : /titre/style/Rock
endpoints.MapControllerRoute(
name: "TitresParStyle",
pattern: "titres/style/{style}",
defaults: new { controller = "Titre", action = "Style" });
// --- ACTIONS POST (LIKE / COMMENT) ---
endpoints.MapControllerRoute(
name: "TitreLike",
pattern: "titre/like",
defaults: new { controller = "Titre", action = "Like" });
endpoints.MapControllerRoute(
name: "TitreComment",
pattern: "titre/comment",
defaults: new { controller = "Titre", action = "Comment" });
// ----------- ADMIN -----------
// ARTISTES
endpoints.MapControllerRoute(
name: "AdminArtistesIndex",
pattern: "administration/artistes",
defaults: new { area = "Administration", controller = "Artiste", action = "Index" });
// --- COMMENTAIRES ---
// COMMENTAIRES
endpoints.MapControllerRoute(
name: "AdminCommentairesIndex",
pattern: "administration/commentaires",
defaults: new { area = "Administration", controller = "Commentaire", action = "Index" });
// --- STYLES ---
// STYLES
endpoints.MapControllerRoute(
name: "AdminStylesIndex",
pattern: "administration/styles",
defaults: new { area = "Administration", controller = "Style", action = "Index" });
// --- TITRES ---
// TITRES
endpoints.MapControllerRoute(
name: "AdminTitresIndex",
pattern: "administration/titres",