diff --git a/Apps/HackerNet.Web/Controllers/LinksController.cs b/Apps/HackerNet.Web/Controllers/LinksController.cs index cd24de0..7eaab5a 100644 --- a/Apps/HackerNet.Web/Controllers/LinksController.cs +++ b/Apps/HackerNet.Web/Controllers/LinksController.cs @@ -1,5 +1,4 @@ using HackerNet.Application; -using HackerNet.Infrastructure.Repositories.Memory; using Microsoft.AspNetCore.Mvc; namespace HackerNet.Web.Controllers; @@ -21,6 +20,14 @@ public class LinksController : Controller // return View(_linkRepository.GetAll());// retourne Link[] } + // TODO: Page de détail d'un lien + + [HttpGet] + public IActionResult Detail(Guid id) + { + return View(_linkService.GetLinkDetail(id)); + } + [HttpGet] public IActionResult New() { @@ -28,6 +35,7 @@ public class LinksController : Controller } [HttpPost] + [ValidateAntiForgeryToken] public IActionResult New(PublishLinkCommand cmd) { if (!ModelState.IsValid) diff --git a/Apps/HackerNet.Web/Views/Links/Detail.cshtml b/Apps/HackerNet.Web/Views/Links/Detail.cshtml new file mode 100644 index 0000000..486375f --- /dev/null +++ b/Apps/HackerNet.Web/Views/Links/Detail.cshtml @@ -0,0 +1,6 @@ +@model HackerNet.Application.LinkHomePage +@{ + ViewData["Title"] = $"Détail du lien {Model.Url}"; +} + + \ No newline at end of file diff --git a/Apps/HackerNet.Web/Views/Shared/_Layout.cshtml b/Apps/HackerNet.Web/Views/Shared/_Layout.cshtml index 2cbb0ce..65a770b 100644 --- a/Apps/HackerNet.Web/Views/Shared/_Layout.cshtml +++ b/Apps/HackerNet.Web/Views/Shared/_Layout.cshtml @@ -7,7 +7,7 @@ -
+