-
-
Notifications
You must be signed in to change notification settings - Fork 145
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
Refactor tag retrieval in ArticlesPage component to Drizzle #835
Refactor tag retrieval in ArticlesPage component to Drizzle #835
Conversation
@NiallJoeMaher is attempting to deploy a commit to the Codú Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe recent update involves modifications across the application and server layers, focusing on simplifying the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (3)
- app/(app)/articles/_client.tsx (3 hunks)
- server/api/router/tag.ts (1 hunks)
- server/db/schema.ts (1 hunks)
Additional comments: 6
server/api/router/tag.ts (2)
- 9-18: The query construction for fetching tag data using
drizzle-orm
is well-implemented, correctly utilizing methods likecount
,groupBy
,leftJoin
,limit
, andorderBy
to achieve the desired functionality.- 1-23: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [20-26]
The error handling mechanism is correctly implemented, ensuring that any exceptions during the query execution are caught and a meaningful
TRPCError
is thrown. This is a good practice for providing clear error feedback to the client.app/(app)/articles/_client.tsx (3)
- 51-51: The adjustment to call the
useQuery
hook without parameters aligns with the refactor objectives and simplifies the tag fetching mechanism.- 189-196: The changes to the mapping of
tagsData
, including the direct destructuring of thetitle
property and its use inkey
andhref
values, simplify data handling and improve code readability.- 189-196: The use of the
title
property in lowercase forhref
values and as the key for mapped elements enhances URL aesthetics and ensures unique keys for React elements, aligning with the PR objectives.server/db/schema.ts (1)
- 83-83: Making the
title
field non-nullable in thetag
table declaration is a best practice for database design, enhancing data integrity and consistency across the platform.
✨ Codu Pull Request 💻
Pull Request details
Any Breaking changes
Summary by CodeRabbit