Skip to content

Commit

Permalink
Remove 0 registrations
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchernchong committed Jul 27, 2024
1 parent 541667c commit 4bc3bc4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions components/Leaderboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const getPopularMakes = (cars: Car[], fuelType: string): PopularMake[] => {
});

return Object.entries(makeCount)
.filter(([_, number]) => Boolean(number)) // Remove 0 registrations
.map(([make, number]) => ({ make, number }))
.sort((a, b) => b.number - a.number)
.slice(0, 3);
Expand Down

0 comments on commit 4bc3bc4

Please sign in to comment.