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

#165378746 User can get a list of suggested users to follow #102

Merged
merged 8 commits into from
Apr 17, 2019

Conversation

sojida
Copy link
Contributor

@sojida sojida commented Apr 16, 2019

Description

Currently, when a user has activities on the application, we can use those activities to suggest follows for the user.

Type of change

  • New Feature(create route to get user suggestions)

How Has This Been Tested?

  • End to End testing

Checklist:

  • Write test cases
  • Create a route to get suggested article

PT-ID

#165378746

Screenshots

Screenshot 2019-04-16 at 4 18 23 PM

Questions:

N/A

@@ -0,0 +1,15 @@
const getAuthorsIdFromArticle = (req, obj) => {
const allUserIds = obj.map(item => {

Choose a reason for hiding this comment

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

Unexpected block statement surrounding arrow body; move the returned value immediately after the => arrow-body-style

@@ -156,6 +156,17 @@ const patchProfile = async (req, res) => {
}
};

const controller = { getUserProfile, getProfileByField, patchProfile };
const suggestedResearchers = (req, res) => {

Choose a reason for hiding this comment

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

Unexpected block statement surrounding arrow body; move the returned value immediately after the => arrow-body-style

@Akinmyde Akinmyde temporarily deployed to hermes-ah-backend-stagi-pr-102 April 16, 2019 22:15 Inactive

const uniqueIds = [...new Set(allUserIds)];

const removeUserOwnId = uniqueIds.filter(
Copy link
Contributor

Choose a reason for hiding this comment

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

Give this is a better name. This sounds like the name of a function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍🏾

router.get(
'/suggested/researchers',
tokenValidator.verifyToken,
profileMiddleware.getAuthorOFArticleUserLiked,
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be Of

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍🏾I' ll fix this

@Akinmyde Akinmyde temporarily deployed to hermes-ah-backend-stagi-pr-102 April 17, 2019 07:50 Inactive

const uniqueIds = [...new Set(allUserIds)];

const ids = uniqueIds.filter(item => item !== req.user.userObj.id);
Copy link
Contributor

Choose a reason for hiding this comment

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

You could just return uniqueIds.filter(...) directly

Copy link
Contributor

Choose a reason for hiding this comment

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

And leave a comment explaining what it's doing

@Akinmyde Akinmyde temporarily deployed to hermes-ah-backend-stagi-pr-102 April 17, 2019 10:29 Inactive
@rotimi-babalola rotimi-babalola merged commit 6f743f4 into develop Apr 17, 2019
@rotimi-babalola rotimi-babalola deleted the 165378746-feature/suggested-followers branch April 17, 2019 10:55
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

4 participants