andela / ah-kgl-wakanda-backend

0 stars 5 forks source link

#165020129 Like or Unlike an article #24

Closed dusmel closed 5 years ago

dusmel commented 5 years ago

What does this PR do?

• Enable users to like or unlike an article

Description of Task to be completed?

• wrote unit tests • Document the endpoints using swagger • Added two endpoints for like and unlike • Restricted the access to use the endpoints only to logged in users

How should this be manually tested?

• Like POST api/articles/:slug/favorite

• Unlike DELETE api/articles/:slug/favorite

Any background context you want to provide?

N/A

What are the relevant pivotal tracker stories?

165020129

Screenshots (if appropriate)

image

Questions:

N/A

coolbeatz71 commented 5 years ago

Hey @dusmel , It is actually possible to implement a nested ternary , useful for adding validation on req.body, req.params and req.query at the same time