{"action":"created","comment":{"url":"https://api.github.com/repos/andela/kakashi-cfh/pulls/comments/110523095","pull_request_review_id":31705778,"id":110523095,"diff_hunk":"@@ -29,17 +29,132 @@ exports.authCallback = (req, res) => {\n \n exports.findUsers = (req, res) => {\n   User.find({}).select('name email').then((allUsers) => {\n-    res.send(allUsers);\n+    res.status(200)\n+      .json(allUsers);\n   });\n };\n \n exports.findUser = (req, res) => {\n   const userid = req.params.userid;\n   User.findById(userid, (err, oneUser) => {\n     if (!err) {\n-      res.send(oneUser);\n+      res.status(200)\n+        .json(oneUser);\n     } else {\n-      res.send('An error occurred');\n+      res.status(401)","path":"app/controllers/users.js","position":19,"original_position":19,"commit_id":"14a7cc4426a2a20bca8d3d4c56c23960de9a16a7","original_commit_id":"14a7cc4426a2a20bca8d3d4c56c23960de9a16a7","user":{"login":"andela-dowoade","id":16131424,"avatar_url":"https://avatars2.githubusercontent.com/u/16131424?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-dowoade","html_url":"https://github.com/andela-dowoade","followers_url":"https://api.github.com/users/andela-dowoade/followers","following_url":"https://api.github.com/users/andela-dowoade/following{/other_user}","gists_url":"https://api.github.com/users/andela-dowoade/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-dowoade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-dowoade/subscriptions","organizations_url":"https://api.github.com/users/andela-dowoade/orgs","repos_url":"https://api.github.com/users/andela-dowoade/repos","events_url":"https://api.github.com/users/andela-dowoade/events{/privacy}","received_events_url":"https://api.github.com/users/andela-dowoade/received_events","type":"User","site_admin":false},"body":"`401` means unauthorised which I am not sure is ideal in this case. You'll probably want to use a `400` or `500` in most cases for errors depending on what the case may be and a `404` if a particular resource is not found.\r\n\r\nTip: mongoose `findById` does not throw an error if the resource returned is empty. i.e `oneUser` in this case may still be null if `err` is null.\r\n\r\nhttps://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html\r\n","created_at":"2017-04-08T17:21:32Z","updated_at":"2017-04-08T17:21:32Z","html_url":"https://github.com/andela/kakashi-cfh/pull/24#discussion_r110523095","pull_request_url":"https://api.github.com/repos/andela/kakashi-cfh/pulls/24","_links":{"self":{"href":"https://api.github.com/repos/andela/kakashi-cfh/pulls/comments/110523095"},"html":{"href":"https://github.com/andela/kakashi-cfh/pull/24#discussion_r110523095"},"pull_request":{"href":"https://api.github.com/repos/andela/kakashi-cfh/pulls/24"}}},"pull_request":{"url":"https://api.github.com/repos/andela/kakashi-cfh/pulls/24","id":114814764,"html_url":"https://github.com/andela/kakashi-cfh/pull/24","diff_url":"https://github.com/andela/kakashi-cfh/pull/24.diff","patch_url":"https://github.com/andela/kakashi-cfh/pull/24.patch","issue_url":"https://api.github.com/repos/andela/kakashi-cfh/issues/24","number":24,"state":"open","locked":false,"title":"#141404671 add Player communities","user":{"login":"andela-jomadoye","id":26272732,"avatar_url":"https://avatars2.githubusercontent.com/u/26272732?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-jomadoye","html_url":"https://github.com/andela-jomadoye","followers_url":"https://api.github.com/users/andela-jomadoye/followers","following_url":"https://api.github.com/users/andela-jomadoye/following{/other_user}","gists_url":"https://api.github.com/users/andela-jomadoye/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-jomadoye/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-jomadoye/subscriptions","organizations_url":"https://api.github.com/users/andela-jomadoye/orgs","repos_url":"https://api.github.com/users/andela-jomadoye/repos","events_url":"https://api.github.com/users/andela-jomadoye/events{/privacy}","received_events_url":"https://api.github.com/users/andela-jomadoye/received_events","type":"User","site_admin":false},"body":"#### What does this PR do?\r\nThis PR adds the players community feature to the app\r\n\r\n#### Description of Task to be completed?\r\nRegistered users should be able to invite other users to connect as \"friends\"\r\n\r\n#### How should this be manually tested?\r\nClick the `invite friends` button on the game page\r\n\r\n#### Any background context you want to provide?\r\n- Users can add friends.\r\n- Users can delete friends.\r\n\r\n#### What are the relevant pivotal tracker stories?\r\n#141404671\r\n\r\n#### Screenshots (if appropriate)\r\n<img width=\"1280\" alt=\"screen shot 2017-04-07 at 12 58 50 pm\" src=\"https://cloud.githubusercontent.com/assets/26272732/24799231/0759d826-1b92-11e7-9fc9-7e7d9a0d3cfe.png\">\r\n<img width=\"1280\" alt=\"screen shot 2017-04-07 at 12 59 01 pm\" src=\"https://cloud.githubusercontent.com/assets/26272732/24799232/075d1ba8-1b92-11e7-84f3-82962ac6e79e.png\">\r\n<img width=\"1280\" alt=\"screen shot 2017-04-07 at 12 59 11 pm\" src=\"https://cloud.githubusercontent.com/assets/26272732/24799233/075de966-1b92-11e7-80b7-14b7f1b316d8.png\">\r\n\r\n\r\n#### Questions:\r\nN/A\r\n","created_at":"2017-04-07T13:22:25Z","updated_at":"2017-04-08T17:21:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a020f55d6cdbcc54049dbd5f3eac6ebfa30db205","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/andela/kakashi-cfh/pulls/24/commits","review_comments_url":"https://api.github.com/repos/andela/kakashi-cfh/pulls/24/comments","review_comment_url":"https://api.github.com/repos/andela/kakashi-cfh/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela/kakashi-cfh/issues/24/comments","statuses_url":"https://api.github.com/repos/andela/kakashi-cfh/statuses/14a7cc4426a2a20bca8d3d4c56c23960de9a16a7","head":{"label":"andela:feature/141404671/player-communities","ref":"feature/141404671/player-communities","sha":"14a7cc4426a2a20bca8d3d4c56c23960de9a16a7","user":{"login":"andela","id":4100206,"avatar_url":"https://avatars1.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":77921917,"name":"kakashi-cfh","full_name":"andela/kakashi-cfh","owner":{"login":"andela","id":4100206,"avatar_url":"https://avatars1.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/kakashi-cfh","description":null,"fork":false,"url":"https://api.github.com/repos/andela/kakashi-cfh","forks_url":"https://api.github.com/repos/andela/kakashi-cfh/forks","keys_url":"https://api.github.com/repos/andela/kakashi-cfh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/kakashi-cfh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/kakashi-cfh/teams","hooks_url":"https://api.github.com/repos/andela/kakashi-cfh/hooks","issue_events_url":"https://api.github.com/repos/andela/kakashi-cfh/issues/events{/number}","events_url":"https://api.github.com/repos/andela/kakashi-cfh/events","assignees_url":"https://api.github.com/repos/andela/kakashi-cfh/assignees{/user}","branches_url":"https://api.github.com/repos/andela/kakashi-cfh/branches{/branch}","tags_url":"https://api.github.com/repos/andela/kakashi-cfh/tags","blobs_url":"https://api.github.com/repos/andela/kakashi-cfh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/kakashi-cfh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/kakashi-cfh/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/kakashi-cfh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/kakashi-cfh/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/kakashi-cfh/languages","stargazers_url":"https://api.github.com/repos/andela/kakashi-cfh/stargazers","contributors_url":"https://api.github.com/repos/andela/kakashi-cfh/contributors","subscribers_url":"https://api.github.com/repos/andela/kakashi-cfh/subscribers","subscription_url":"https://api.github.com/repos/andela/kakashi-cfh/subscription","commits_url":"https://api.github.com/repos/andela/kakashi-cfh/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/kakashi-cfh/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/kakashi-cfh/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/kakashi-cfh/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/kakashi-cfh/contents/{+path}","compare_url":"https://api.github.com/repos/andela/kakashi-cfh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/kakashi-cfh/merges","archive_url":"https://api.github.com/repos/andela/kakashi-cfh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/kakashi-cfh/downloads","issues_url":"https://api.github.com/repos/andela/kakashi-cfh/issues{/number}","pulls_url":"https://api.github.com/repos/andela/kakashi-cfh/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/kakashi-cfh/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/kakashi-cfh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/kakashi-cfh/labels{/name}","releases_url":"https://api.github.com/repos/andela/kakashi-cfh/releases{/id}","deployments_url":"https://api.github.com/repos/andela/kakashi-cfh/deployments","created_at":"2017-01-03T14:00:09Z","updated_at":"2017-03-09T13:17:03Z","pushed_at":"2017-04-08T14:30:09Z","git_url":"git://github.com/andela/kakashi-cfh.git","ssh_url":"git@github.com:andela/kakashi-cfh.git","clone_url":"https://github.com/andela/kakashi-cfh.git","svn_url":"https://github.com/andela/kakashi-cfh","homepage":null,"size":11672,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"andela:develop","ref":"develop","sha":"f9a200383c3e55f32783fcd3c64a6d8e4c8fdace","user":{"login":"andela","id":4100206,"avatar_url":"https://avatars1.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":77921917,"name":"kakashi-cfh","full_name":"andela/kakashi-cfh","owner":{"login":"andela","id":4100206,"avatar_url":"https://avatars1.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/kakashi-cfh","description":null,"fork":false,"url":"https://api.github.com/repos/andela/kakashi-cfh","forks_url":"https://api.github.com/repos/andela/kakashi-cfh/forks","keys_url":"https://api.github.com/repos/andela/kakashi-cfh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/kakashi-cfh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/kakashi-cfh/teams","hooks_url":"https://api.github.com/repos/andela/kakashi-cfh/hooks","issue_events_url":"https://api.github.com/repos/andela/kakashi-cfh/issues/events{/number}","events_url":"https://api.github.com/repos/andela/kakashi-cfh/events","assignees_url":"https://api.github.com/repos/andela/kakashi-cfh/assignees{/user}","branches_url":"https://api.github.com/repos/andela/kakashi-cfh/branches{/branch}","tags_url":"https://api.github.com/repos/andela/kakashi-cfh/tags","blobs_url":"https://api.github.com/repos/andela/kakashi-cfh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/kakashi-cfh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/kakashi-cfh/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/kakashi-cfh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/kakashi-cfh/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/kakashi-cfh/languages","stargazers_url":"https://api.github.com/repos/andela/kakashi-cfh/stargazers","contributors_url":"https://api.github.com/repos/andela/kakashi-cfh/contributors","subscribers_url":"https://api.github.com/repos/andela/kakashi-cfh/subscribers","subscription_url":"https://api.github.com/repos/andela/kakashi-cfh/subscription","commits_url":"https://api.github.com/repos/andela/kakashi-cfh/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/kakashi-cfh/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/kakashi-cfh/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/kakashi-cfh/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/kakashi-cfh/contents/{+path}","compare_url":"https://api.github.com/repos/andela/kakashi-cfh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/kakashi-cfh/merges","archive_url":"https://api.github.com/repos/andela/kakashi-cfh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/kakashi-cfh/downloads","issues_url":"https://api.github.com/repos/andela/kakashi-cfh/issues{/number}","pulls_url":"https://api.github.com/repos/andela/kakashi-cfh/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/kakashi-cfh/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/kakashi-cfh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/kakashi-cfh/labels{/name}","releases_url":"https://api.github.com/repos/andela/kakashi-cfh/releases{/id}","deployments_url":"https://api.github.com/repos/andela/kakashi-cfh/deployments","created_at":"2017-01-03T14:00:09Z","updated_at":"2017-03-09T13:17:03Z","pushed_at":"2017-04-08T14:30:09Z","git_url":"git://github.com/andela/kakashi-cfh.git","ssh_url":"git@github.com:andela/kakashi-cfh.git","clone_url":"https://github.com/andela/kakashi-cfh.git","svn_url":"https://github.com/andela/kakashi-cfh","homepage":null,"size":11672,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/andela/kakashi-cfh/pulls/24"},"html":{"href":"https://github.com/andela/kakashi-cfh/pull/24"},"issue":{"href":"https://api.github.com/repos/andela/kakashi-cfh/issues/24"},"comments":{"href":"https://api.github.com/repos/andela/kakashi-cfh/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/andela/kakashi-cfh/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/andela/kakashi-cfh/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela/kakashi-cfh/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/andela/kakashi-cfh/statuses/14a7cc4426a2a20bca8d3d4c56c23960de9a16a7"}}}}
{"actor":{"display_login":"andela-dowoade"}}