-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
backendThis is a backend issueThis is a backend issuestagingIssue merged into stagingIssue merged into staging
Description
Is your feature request related to a problem? Please describe.
We need to build a feature to like a comment. We also need a way to keep track of the number of times an article is viewed.
Models
Article
- Add a views column. It should be an integer with the default of 0.
Comment
- Add a liking system to comments. It should be very similar to Article likes.
- Should be creating a many to many association with Comments and Profiles
Schemas
- Edit the Comment schema to include the likes
- Edit the Article schema to include the views
API Routes
Endpoints | HTTP Method | Description | Tested
/api/articles/{{slug}} | Get | The view count should increase each time this is called |
/api/comments/{{commentId}}/favorite | POST | Add the user to the comment's favorites relationship |
Create/Edit Functions
get_article
- Each time function is called, add 1 to the view count.
favorite_a_comment
- Should query for the comment and profile. If they both exist then add the profile to the comment's favorite
Additional context
- Adjust the article tests in the
backend/tests/test_articles.pyfile. Some of them don't currently pass. So adjust the routes or tests accordingly to make sure that they work.
Metadata
Metadata
Assignees
Labels
backendThis is a backend issueThis is a backend issuestagingIssue merged into stagingIssue merged into staging