From b71d2c6aaead6db2ed00d48da55c4592a43f0922 Mon Sep 17 00:00:00 2001 From: Julien Oculi Date: Mon, 1 Jul 2024 13:18:54 +0200 Subject: [PATCH] refactor(route): :recycle: renames route parameter to fit real behaviour --- routes/blog/{[id].tsx => [name].tsx} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename routes/blog/{[id].tsx => [name].tsx} (55%) diff --git a/routes/blog/[id].tsx b/routes/blog/[name].tsx similarity index 55% rename from routes/blog/[id].tsx rename to routes/blog/[name].tsx index d178682..caa021b 100644 --- a/routes/blog/[id].tsx +++ b/routes/blog/[name].tsx @@ -1,8 +1,8 @@ import { PageProps } from '$fresh/server.ts' -import { BlogCard, blogMock } from '../../components/BlogCard.tsx' +import { BlogCard, blogMock } from ':components/BlogCard.tsx' export default function Projet({ params }: PageProps) { - const article = blogMock.at(Number(params.id)) + const article = blogMock.filter(blogEntry => blogEntry.name === params.name)[0] return ( article ? BlogCard(article) :

Article inconnu