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

#167190540 Implement Follow And Unfollow User Feature #27

Merged
merged 1 commit into from
Aug 8, 2019

Conversation

henryade
Copy link
Contributor

@henryade henryade commented Aug 6, 2019

What does this PR do?

It allows users to follow and unfollow other users, get all followers and get all users they follow.

Description of Task proposed in this pull request?

  • create user follower model
  • create follow user route
  • create unfollow user route
  • create get followers route
  • create get followings route
  • write end to end test on all route
  • write model unit tests

How should this be manually tested (Quality Assurance)?

  • clone repo and checkout to this branch
  • signup two users and copy the first users token and the second user's username

To Follow

  • run POST /api/v1/profiles/{username}/followadd the first users token to the authorization header

To get All followers

  • run GET /api/v1/profiles/followers add the first users token to the authorization header

To get All followings

  • run GET /api/v1/profiles/followings add the first users token to the authorization header

To Unfollow

  • run DELETE /api/v1/profiles/{username}/followadd the first users token to the authorization header

What are the relevant pivotal tracker stories?

Any background context you want to add (Operations Impact)?

N/A

What I have learned working on this feature:

  • I learned how to write model tests and add custom error messages to models.
  • I learned how to use sequelize magic methods.

Screenshots:

User Successfully follows another user:
Screenshot 2019-08-08 at 4 27 49 PM

User Successfully unfollow another user:
Screenshot 2019-08-08 at 4 31 34 PM

Other User View All Followers:
Screenshot 2019-08-08 at 4 31 03 PM

User View All Followings:
Screenshot 2019-08-08 at 4 28 22 PM

test/models/userFollowers.test.js Outdated Show resolved Hide resolved
test/models/userFollowers.test.js Outdated Show resolved Hide resolved
test/models/userFollowers.test.js Outdated Show resolved Hide resolved
test/models/userFollowers.test.js Outdated Show resolved Hide resolved
test/models/userFollowers.test.js Outdated Show resolved Hide resolved
test/followers/follower.test.js Show resolved Hide resolved
test/followers/follower.test.js Outdated Show resolved Hide resolved
test/followers/follower.test.js Show resolved Hide resolved
test/followers/follower.test.js Show resolved Hide resolved
@henryade henryade added pr:review This is PR is currently under review by team type:feature A new feature labels Aug 6, 2019
@henryade henryade force-pushed the ft-user-follower-167190540 branch 3 times, most recently from e19e848 to da037f8 Compare August 7, 2019 07:55
@chialuka chialuka temporarily deployed to authors-haven-developmen-pr-27 August 7, 2019 07:55 Inactive
test/followers/follower.test.js Show resolved Hide resolved
test/followers/follower.test.js Outdated Show resolved Hide resolved
@henryade henryade temporarily deployed to authors-haven-developmen-pr-27 August 7, 2019 10:04 Inactive
@henryade henryade temporarily deployed to authors-haven-developmen-pr-27 August 7, 2019 13:09 Inactive
Adekoreday
Adekoreday previously approved these changes Aug 7, 2019
@henryade henryade temporarily deployed to authors-haven-developmen-pr-27 August 8, 2019 06:16 Inactive
test/followers/follower.test.js Show resolved Hide resolved
test/followers/follower.test.js Show resolved Hide resolved
test/followers/follower.test.js Show resolved Hide resolved
test/followers/follower.test.js Show resolved Hide resolved
Adekoreday
Adekoreday previously approved these changes Aug 8, 2019
@henryade henryade temporarily deployed to authors-haven-developmen-pr-27 August 8, 2019 11:42 Inactive
@henryade henryade added pr:ready This PR is ready to be merged and removed pr:review This is PR is currently under review by team labels Aug 8, 2019
Adekoreday
Adekoreday previously approved these changes Aug 8, 2019
@henryade henryade temporarily deployed to authors-haven-developmen-pr-27 August 8, 2019 13:39 Inactive
Adekoreday
Adekoreday previously approved these changes Aug 8, 2019
JuwonAbiola
JuwonAbiola previously approved these changes Aug 8, 2019
@henryade henryade dismissed stale reviews from JuwonAbiola and Adekoreday via 2452e79 August 8, 2019 15:16
@henryade henryade temporarily deployed to authors-haven-developmen-pr-27 August 8, 2019 15:16 Inactive
chialuka
chialuka previously approved these changes Aug 8, 2019
Copy link
Contributor

@chialuka chialuka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job.

- create user follower model
- create follow user route
- create unfollow user route
- create get followers route
- create get followings route
- write end to end test on all route
- write model unit tests

[Delivers #167190540]
@henryade henryade temporarily deployed to authors-haven-development August 8, 2019 15:53 Inactive
@dinobi dinobi merged commit 92bd4ca into develop Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:ready This PR is ready to be merged type:feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants