Skip to content

Commit

Permalink
Merge pull request #123 from MAGICGrants/fixes
Browse files Browse the repository at this point in the history
fix: correctly query leaderboard
  • Loading branch information
Keeqler authored Dec 26, 2024
2 parents 3bbc5a6 + 577ed94 commit d810bdb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/routers/leaderboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ export const leaderboardRouter = router({

const withUserDonationSums = await prisma.donation.groupBy({
by: ['userId', 'showDonorNameOnLeaderboard', 'donorName'],
where: { userId: { not: null } },
where: { userId: { not: null }, fundSlug: input.fundSlug, projectSlug: input.projectSlug },
_sum: { grossFiatAmount: true },
orderBy: { _sum: { grossFiatAmount: 'desc' } },
take: leaderboardLimit,
})

const noUserDonations = await prisma.donation.findMany({
where: { userId: null },
where: { userId: null, fundSlug: input.fundSlug, projectSlug: input.projectSlug },
orderBy: { grossFiatAmount: 'desc' },
take: leaderboardLimit,
})
Expand Down

0 comments on commit d810bdb

Please sign in to comment.