Skip to content

fix(tag): fix findTrending sort order using windowed post count#94

Merged
aquie00t merged 1 commit intomainfrom
fix/tag-trending-sort-order
Apr 23, 2026
Merged

fix(tag): fix findTrending sort order using windowed post count#94
aquie00t merged 1 commit intomainfrom
fix/tag-trending-sort-order

Conversation

@aquie00t
Copy link
Copy Markdown
Collaborator

Prisma's orderBy: { posts: { _count } } counts all-time posts, not the filtered window. Removed the Prisma-level orderBy/take and replaced with application-level sort by posts.length (windowed count) followed by slice.

What does this PR do?

A brief description of the changes introduced.

Closes #


Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Chore

Checklist

  • My branch follows the naming convention (feature/, fix/, chore/, docs/)
  • My commits follow Conventional Commits
  • I have tested my changes locally
  • I have not introduced any breaking changes
  • I have updated relevant documentation if needed

Prisma's orderBy: { posts: { _count } } counts all-time posts, not the
filtered window. Removed the Prisma-level orderBy/take and replaced with
application-level sort by posts.length (windowed count) followed by slice.
@aquie00t aquie00t merged commit 7a11410 into main Apr 23, 2026
6 checks passed
@aquie00t aquie00t deleted the fix/tag-trending-sort-order branch April 23, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant