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

#162163273 Users should be able to favorite articles. #19

Merged
merged 2 commits into from
Dec 17, 2018

Conversation

joshtrigger
Copy link
Contributor

@joshtrigger joshtrigger commented Dec 13, 2018

What does this PR do?
This Pull Request enables a user to favorite an article

Description of tasks
Below are the endpoints that enable the user have the access to favorite or unfavorite an article
POST /api/articles/<slug>/favorite/
DELETE /api/articles/<slug>/favorite/

How to manually test it

  • clone the repository

  • install the dependencies in the requirements.txt file

  • the POST /api/articles/<slug>/favorite/ should return

{
  "article": {
    "slug": "how-to-train-your-dragon",
    "title": "How to train your dragon",
    "description": "Ever wonder how?",
    "body": "It takes a Jacobian",
    "tagList": ["dragons", "training"],
    "createdAt": "2016-02-18T03:22:56.637Z",
    "updatedAt": "2016-02-18T03:48:35.824Z",
    "favorited": true,
    "favoritesCount": 2,
    "author": {
      "username": "jake",
      "bio": "I work at statefarm",
      "image": "https://i.stack.imgur.com/xHWG8.jpg",
      "following": false
    }
  }
}
  • the DELETE /api/articles/<slug>/favorite/ should return
{
 "message":{
  "body":[
    "article has been unfavorited"
  ]
 }
}

Relevant pivotal tracker stories
#162163273

@joshtrigger joshtrigger force-pushed the ft-favourite-article-162163273 branch 2 times, most recently from 6430504 to faa19c0 Compare December 13, 2018 17:31
@Kasulejoseph
Copy link
Collaborator

@joshtrigger you have some conflicts to fix

user should be able to favorite an article

author can get favourites count

write unittests for favourating articles

[Delivers #162163273]
make database migrations

[Delivers #162163273]
@collin5 collin5 merged commit 73706b5 into develop Dec 17, 2018
@collin5 collin5 deleted the ft-favourite-article-162163273 branch December 17, 2018 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants