From 42306591168d047d099ac8592111ecb56772c00c Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Sat, 2 Mar 2024 10:24:59 +0000 Subject: [PATCH] fix: URL decode tag names to allow accessing tags with spaces in their name --- packages/web/app/dashboard/tags/[tagName]/page.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/web/app/dashboard/tags/[tagName]/page.tsx b/packages/web/app/dashboard/tags/[tagName]/page.tsx index 066315d0..fa3a1f8e 100644 --- a/packages/web/app/dashboard/tags/[tagName]/page.tsx +++ b/packages/web/app/dashboard/tags/[tagName]/page.tsx @@ -15,10 +15,11 @@ export default async function TagPage({ if (!session) { redirect("/"); } + const tagName = decodeURIComponent(params.tagName); const tag = await db.query.bookmarkTags.findFirst({ where: and( eq(bookmarkTags.userId, session.user.id), - eq(bookmarkTags.name, params.tagName), + eq(bookmarkTags.name, tagName), ), columns: { id: true, @@ -46,7 +47,7 @@ export default async function TagPage({ return (
- {params.tagName} + {tagName}