Skip to content

Commit

Permalink
fix: URL decode tag names to allow accessing tags with spaces in thei…
Browse files Browse the repository at this point in the history
…r name
  • Loading branch information
MohamedBassem committed Mar 2, 2024
1 parent cf77fa8 commit 4230659
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/web/app/dashboard/tags/[tagName]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -46,7 +47,7 @@ export default async function TagPage({

return (
<div className="container flex flex-col gap-3">
<span className="pt-4 text-2xl">{params.tagName}</span>
<span className="pt-4 text-2xl">{tagName}</span>
<hr />
<BookmarksGrid query={query} bookmarks={bookmarks.bookmarks} />
</div>
Expand Down

0 comments on commit 4230659

Please sign in to comment.