-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Description
This feature adds highlighting for comments made by users with the "Regular Commenter" achievement badge.
Changes needed:
- Modify the comment retrieval endpoint to check if a commenter has the "Regular Commenter" achievement
- Add a
should_highlightboolean flag to comment data in the API response - Maintain privacy by not exposing any personal user information
Implementation Details
- In
restaurant_routes.py, modify the/restaurants/<int:restaurant_id>/commentsGET endpoint - For each comment, check if its author has the "Regular Commenter" achievement
- Add a
should_highlightflag to the comment JSON data - The frontend will use this flag to highlight the comment in the UI
Technical Approach
- Query
UserAchievementtable to check if the comment's author has the "Regular Commenter" achievement - Add the highlight flag to the comment data structure
- Update API documentation to reflect this new field
Benefits
- Enhanced user experience by visually distinguishing comments from experienced users
- Creates a gamification feature that incentivizes users to submit more comments
- Maintains user privacy by not exposing which specific user made which comment
Testing
- Verify that comments from users with the achievement are properly flagged
- Confirm that no PII or user-specific data is leaked in the process
- Test with various combinations of users with and without achievements
Metadata
Metadata
Assignees
Labels
No labels