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

Comment Likes and Views count #93

Open
5 tasks done
bryanwong8 opened this issue Jun 21, 2020 · 0 comments
Open
5 tasks done

Comment Likes and Views count #93

bryanwong8 opened this issue Jun 21, 2020 · 0 comments
Assignees
Labels
backend This is a backend issue staging Issue merged into staging
Projects

Comments

@bryanwong8
Copy link
Contributor

bryanwong8 commented Jun 21, 2020

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.py file. Some of them don't currently pass. So adjust the routes or tests accordingly to make sure that they work.
@project-bot project-bot bot added this to To do in Bit Project Jun 21, 2020
@bryanwong8 bryanwong8 added the backend This is a backend issue label Jun 21, 2020
@bryanwong8 bryanwong8 added the staging Issue merged into staging label Jun 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend This is a backend issue staging Issue merged into staging
Projects
Bit Project
  
To do
Development

No branches or pull requests

2 participants