-
Notifications
You must be signed in to change notification settings - Fork 8
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
#165378746 User can get a list of suggested users to follow #102
Conversation
server/helpers/aurhors-id-helper.js
Outdated
@@ -0,0 +1,15 @@ | |||
const getAuthorsIdFromArticle = (req, obj) => { | |||
const allUserIds = obj.map(item => { |
There was a problem hiding this comment.
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) => { |
There was a problem hiding this comment.
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
server/helpers/aurhors-id-helper.js
Outdated
|
||
const uniqueIds = [...new Set(allUserIds)]; | ||
|
||
const removeUserOwnId = uniqueIds.filter( |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏾
server/routes/profile.routes.js
Outdated
router.get( | ||
'/suggested/researchers', | ||
tokenValidator.verifyToken, | ||
profileMiddleware.getAuthorOFArticleUserLiked, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be Of
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏾I' ll fix this
server/helpers/aurhors-id-helper.js
Outdated
|
||
const uniqueIds = [...new Set(allUserIds)]; | ||
|
||
const ids = uniqueIds.filter(item => item !== req.user.userObj.id); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
Description
Currently, when a user has activities on the application, we can use those activities to suggest follows for the user.
Type of change
How Has This Been Tested?
Checklist:
PT-ID
#165378746
Screenshots
Questions:
N/A