#162163173 Fix users unable to see likes and dislikes in articles: #28
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Change Article serializer on view for articles list to display likes and dislikes.
Description of Task to be completed?
Apparently, users are not able to view the likes and dislikes an articles has because the Article serializer doesn't include those fields. This PR fixes this bug by adding those fields to the ArticlesSerializer.
How should this be manually tested?
Make migrations: .
/manage.py makemigrations
Migrate:
./manage.py migrate
Run the server:
./manage.py runserver
Like an article
POST
http://127.0.0.1:8000/api/articles/like/<slug>
Dislike an article
POST
http://127.0.0.1:8000/api/articles/dislike/<slug>
What are the relevant pivotal tracker stories?
#162163170
Any background context you want to add?
You don’t need a body when using these endpoints so add the slug to add the like or dislike to a particular article once the user sends a post to the like endpoint the functionality will be triggered.
Screenshots (if appropriate)