Skip to content

Commit

Permalink
fix: Tag filtering and sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedBassem committed Feb 22, 2024
1 parent 0aa4760 commit c2e7ae2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/web/app/dashboard/tags/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand All @@ -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);

Expand Down

0 comments on commit c2e7ae2

Please sign in to comment.