From c2e7ae299bb96b2fbe3ed41c49d4dba95a6c767b Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Thu, 22 Feb 2024 21:54:51 +0000 Subject: [PATCH] fix: Tag filtering and sorting --- packages/web/app/dashboard/tags/page.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/web/app/dashboard/tags/page.tsx b/packages/web/app/dashboard/tags/page.tsx index 687599c5..d76a7f91 100644 --- a/packages/web/app/dashboard/tags/page.tsx +++ b/packages/web/app/dashboard/tags/page.tsx @@ -23,7 +23,7 @@ export default async function TagsPage() { redirect("/"); } - const tags = await prisma.bookmarkTags.findMany({ + let tags = await prisma.bookmarkTags.findMany({ where: { userId: session.user.id, }, @@ -37,7 +37,7 @@ export default async function TagsPage() { }); // Sort tags by usage desc - tags + tags = tags .filter((t) => t._count.bookmarks > 0) .sort((a, b) => b._count.bookmarks - a._count.bookmarks);