diff --git a/Webzine.WebApplication/Controllers/RechercheController.cs b/Webzine.WebApplication/Controllers/RechercheController.cs index 9d6f7e2..9b52e9b 100644 --- a/Webzine.WebApplication/Controllers/RechercheController.cs +++ b/Webzine.WebApplication/Controllers/RechercheController.cs @@ -10,7 +10,6 @@ namespace Webzine.WebApplication.Controllers using Webzine.WebApplication.ViewModels.Recherche; using Webzine.WebApplication.ViewModels.Titre; - [Route("recherche")] public class RechercheController : Controller { private readonly ILogger logger; @@ -22,7 +21,7 @@ namespace Webzine.WebApplication.Controllers this.titreRepository = titreRepository; } - [HttpPost("")] + [HttpPost] public IActionResult Index(string mot) { this.logger.LogInformation("Recherche artistes/titres pour le mot : {Mot}.", mot); diff --git a/Webzine.WebApplication/Extensions/RouteConfiguration.cs b/Webzine.WebApplication/Extensions/RouteConfiguration.cs index 82fad45..f316a9d 100644 --- a/Webzine.WebApplication/Extensions/RouteConfiguration.cs +++ b/Webzine.WebApplication/Extensions/RouteConfiguration.cs @@ -8,10 +8,17 @@ public static class RouteConfiguration public static void MapCustomRoutes(this IEndpointRouteBuilder endpoints) { + // ----------- RECHERCHE ----------- + // exemple : /artiste/boblechanteurtarpingénial + endpoints.MapControllerRoute( + name: "rechercheIndex", + pattern: "recherche", + defaults: new { controller = "Recherche", action = "Index" }); + // ----------- ARTISTE ----------- // exemple : /artiste/boblechanteurtarpingénial endpoints.MapControllerRoute( - name: "TitreDetails", + name: "ArtisteIndex", pattern: "artiste/{nom}", defaults: new { controller = "Artiste", action = "Index" });