Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE]: Display Count on Category options #132

Open
jamesqquick opened this issue May 16, 2024 · 0 comments
Open

[FEATURE]: Display Count on Category options #132

jamesqquick opened this issue May 16, 2024 · 0 comments
Labels
✨ Feature Requests for new features
Milestone

Comments

@jamesqquick
Copy link
Collaborator

Describe the solution you'd like
As a user, I would like to be able to see how many deals there are by category. I would like to see this count inside of the pill of the category option.

Describe the benefits of your solution
This could further incentivize users to look into specific categories.

Additional Notes

  • this will require adding a new db query in the src/lib/queries.ts file
  • could use prisma groupBy function with _count

Groupby - https://www.prisma.io/docs/orm/prisma-client/queries/aggregation-grouping-summarizing#groupby-and-filtering
Count - https://www.prisma.io/docs/orm/prisma-client/queries/aggregation-grouping-summarizing#count-records

Example (not tested)

  const dealsCountByCategory = await prisma.deals.groupBy({
    by: ['category'],
    _count: {
      _all: true,
    },
  });
@jamesqquick jamesqquick modified the milestones: MVP 2, MVP 1 May 16, 2024
@jamesqquick jamesqquick added ✨ Feature Requests for new features and removed mvp 2 labels May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature Requests for new features
Projects
None yet
Development

No branches or pull requests

1 participant