-
Notifications
You must be signed in to change notification settings - Fork 146
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
Likes Array Of Users in Post and Comment #134
Conversation
Users who have liked the post and comment can be traced
@tharindupr kindly review this PR 😄 |
@shivamarora96 currently if the user likes the same post twice it counts as two votes. We have to limit the user from liking a post more than once. We should probably handle that scenario as well |
@psnmissaka Yeah But this PR would solve that problem |
if(check === -1){ | ||
result.likes.push(currentUserId); | ||
result.save(); | ||
return returnWithResponse.configureReturnData({ status: 200, success: true, result: `${currentUserId}: user liked the post-${currentPostId}`}, response); |
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.
@psnmissaka this would solve the double liking issue
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.
Great! I didn't see it.
@ntbandara3 update the front-end accordingly. If someone has liked a post and presses the like button again then trigger the unlike.
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.
@psnmissaka sure. working on it.
* structuring the front end with angualr 4 * New angular2 branch commit * buidling up the strucure and routes * Added feed component * new file structure * added boostrap to be used for grid layout * UI devlopment in the home page * Common feed basic structure and post service * component to view a particular post * Added the login layer for the app. Login page needs some customizing * changed the root travis and travis in front end * removed unnecessary script from angular-cli.json * redesigned the login page * login button font change * button to add a stack * created the create post component and the route to it * created the create post component and the route to it * created the stack service * Added some response headers to the API endpoint api/orgs * create post related component creation and few changes in the auth services * Profile detail UI created * Create Post UI created * Create post UI change: Added material components * Profile UI changes * Common Feed and Post UI changes * Fixed merge conflict in travis.yml * Fixed merge conflicts in server.js * Fixed merge conflict in routes.js * Added UI elements to profile Table to view number of posts, comments and likes by a particular user * Sidebar style changes * Navigation and Side Bar changes * Set height in the description field * Removed double quotes * Removed duplicate dependency imports * Fixed styling in top navigation bar * Get all subscribed stacks by user service implemented * Changed API endpoint URL * Create Post implementations * Create Post issues fixed * Vote up and Vote down functions implemented * WIP: Post UI changes and vote function integrated * Text wrap in description * Commenting on posts implemented * Token Based OAuth 2.0 Github Added Authentication is added to the application using PassportJS and OAuth 2.0 Github * NPM Packages Updated * Implemented profile information retreiving from github * Fixed issue in profile * Fixed issue in profile - _body in Response error * Implemented snackbar messages for create post function * Added required fields marks in the create post form * Fixed conflicts * Added progress bar when loading the profile info Removed github service and implemented the common profile service * Fixed issue in showSnackBar function * Fixed issue in creating a post * Removed console logs * Fixed issue in post detailed view * Implemented voting on post and comments * PassportJS file Well Formated * AuthJS well formated
@psnmissaka changes Made. Kindly review it |
Users who liked the post can be traced using Likes array in JSON