{"action":"created","comment":{"url":"https://api.github.com/repos/Bastieno/QuickCredit/pulls/comments/286883547","pull_request_review_id":241124343,"id":286883547,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI4Njg4MzU0Nw==","diff_hunk":"@@ -38,13 +87,15 @@ const adminOnly = (req, res, next) => {\n \n const userOnly = (req, res, next) => {\n   const { userId } = req.user;\n-  if (!userId) {\n-    return res.status(403).send({\n-      status: 403,\n-      error: 'Unauthorized Access. For authenticated users only',\n-    });\n-  }\n+  // Fix this: doing nothing!","path":"server/middleware/auth.js","position":74,"original_position":74,"commit_id":"0b030ca650aa6e2e5b7eae8d6f509dc9a557659c","original_commit_id":"0b030ca650aa6e2e5b7eae8d6f509dc9a557659c","user":{"login":"shegsteham","id":25525765,"node_id":"MDQ6VXNlcjI1NTI1NzY1","avatar_url":"https://avatars0.githubusercontent.com/u/25525765?v=4","gravatar_id":"","url":"https://api.github.com/users/shegsteham","html_url":"https://github.com/shegsteham","followers_url":"https://api.github.com/users/shegsteham/followers","following_url":"https://api.github.com/users/shegsteham/following{/other_user}","gists_url":"https://api.github.com/users/shegsteham/gists{/gist_id}","starred_url":"https://api.github.com/users/shegsteham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shegsteham/subscriptions","organizations_url":"https://api.github.com/users/shegsteham/orgs","repos_url":"https://api.github.com/users/shegsteham/repos","events_url":"https://api.github.com/users/shegsteham/events{/privacy}","received_events_url":"https://api.github.com/users/shegsteham/received_events","type":"User","site_admin":false},"body":"@Bastieno can you please attend to this redundancy in the code base?","created_at":"2019-05-23T10:46:36Z","updated_at":"2019-05-23T10:46:37Z","html_url":"https://github.com/Bastieno/QuickCredit/pull/43#discussion_r286883547","pull_request_url":"https://api.github.com/repos/Bastieno/QuickCredit/pulls/43","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Bastieno/QuickCredit/pulls/comments/286883547"},"html":{"href":"https://github.com/Bastieno/QuickCredit/pull/43#discussion_r286883547"},"pull_request":{"href":"https://api.github.com/repos/Bastieno/QuickCredit/pulls/43"}}},"pull_request":{"url":"https://api.github.com/repos/Bastieno/QuickCredit/pulls/43","id":281457798,"node_id":"MDExOlB1bGxSZXF1ZXN0MjgxNDU3Nzk4","html_url":"https://github.com/Bastieno/QuickCredit/pull/43","diff_url":"https://github.com/Bastieno/QuickCredit/pull/43.diff","patch_url":"https://github.com/Bastieno/QuickCredit/pull/43.patch","issue_url":"https://api.github.com/repos/Bastieno/QuickCredit/issues/43","number":43,"state":"open","locked":false,"title":"chore(backend-feedback): Incorporate LFA back-end feedback","user":{"login":"Bastieno","id":47043427,"node_id":"MDQ6VXNlcjQ3MDQzNDI3","avatar_url":"https://avatars3.githubusercontent.com/u/47043427?v=4","gravatar_id":"","url":"https://api.github.com/users/Bastieno","html_url":"https://github.com/Bastieno","followers_url":"https://api.github.com/users/Bastieno/followers","following_url":"https://api.github.com/users/Bastieno/following{/other_user}","gists_url":"https://api.github.com/users/Bastieno/gists{/gist_id}","starred_url":"https://api.github.com/users/Bastieno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bastieno/subscriptions","organizations_url":"https://api.github.com/users/Bastieno/orgs","repos_url":"https://api.github.com/users/Bastieno/repos","events_url":"https://api.github.com/users/Bastieno/events{/privacy}","received_events_url":"https://api.github.com/users/Bastieno/received_events","type":"User","site_admin":false},"body":"#### What does this PR do?\r\n* Incorporate LFA backend feedback\r\n\r\n #### Description of Task to be completed?\r\n* Modify signin route to allow the use of token for signing in\r\n* Implement an endpoint to change the '_isAdmin_' property of a user (i.e. to make a user an admin)\r\n* Modify the base url to make `/api/v1` a valid route\r\n* Write tests to cover these implementations\r\n* Use of _sinon_ and _sinon-chai_ in writing some of my tests. I was able to increase the test coverage. Check the screenshot below.\r\n* Write swagger docs for app\r\n* Make some miscellaneous fixes where necessary\r\n\r\n#### How should this be manually tested?\r\n* Clone the repo `git clone https://github.com/Bastieno/QuickCredit.git`\r\n* Checkout to the branch `git checkout ch-lfa-backend-feedback-166173934`\r\n* Install Postgresql\r\n* Create a database named quickcreditdb_test\r\n* Run `npm install` to install application dependencies\r\n* Test by `npm test`\r\n\r\n#### Screenshots (if appropriate)\r\n![test_result1](https://user-images.githubusercontent.com/47043427/58231445-ee361480-7d2e-11e9-8f7f-ef3563220980.PNG)\r\n\r\n\r\n\r\n#### Questions:\r\nN/A\r\n\r\n#### Any background context you want to provide?\r\nI tried as much to do all the feedback to the letter. I had some problem using _sinon_ because some of the tests I wrote using _sinon_ was passing but I could really see the effect in terms of test coverage.\r\n\r\n#### What are the relevant pivotal tracker stories?\r\n[#166173934](https://www.pivotaltracker.com/n/projects/2328087)","created_at":"2019-05-23T06:20:44Z","updated_at":"2019-05-23T10:46:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c92f59d45376be6dbd7d8d953fc8de0b7e76053f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Bastieno/QuickCredit/pulls/43/commits","review_comments_url":"https://api.github.com/repos/Bastieno/QuickCredit/pulls/43/comments","review_comment_url":"https://api.github.com/repos/Bastieno/QuickCredit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Bastieno/QuickCredit/issues/43/comments","statuses_url":"https://api.github.com/repos/Bastieno/QuickCredit/statuses/0b030ca650aa6e2e5b7eae8d6f509dc9a557659c","head":{"label":"Bastieno:ch-lfa-backend-feedback-166173934","ref":"ch-lfa-backend-feedback-166173934","sha":"0b030ca650aa6e2e5b7eae8d6f509dc9a557659c","user":{"login":"Bastieno","id":47043427,"node_id":"MDQ6VXNlcjQ3MDQzNDI3","avatar_url":"https://avatars3.githubusercontent.com/u/47043427?v=4","gravatar_id":"","url":"https://api.github.com/users/Bastieno","html_url":"https://github.com/Bastieno","followers_url":"https://api.github.com/users/Bastieno/followers","following_url":"https://api.github.com/users/Bastieno/following{/other_user}","gists_url":"https://api.github.com/users/Bastieno/gists{/gist_id}","starred_url":"https://api.github.com/users/Bastieno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bastieno/subscriptions","organizations_url":"https://api.github.com/users/Bastieno/orgs","repos_url":"https://api.github.com/users/Bastieno/repos","events_url":"https://api.github.com/users/Bastieno/events{/privacy}","received_events_url":"https://api.github.com/users/Bastieno/received_events","type":"User","site_admin":false},"repo":{"id":182062076,"node_id":"MDEwOlJlcG9zaXRvcnkxODIwNjIwNzY=","name":"QuickCredit","full_name":"Bastieno/QuickCredit","private":false,"owner":{"login":"Bastieno","id":47043427,"node_id":"MDQ6VXNlcjQ3MDQzNDI3","avatar_url":"https://avatars3.githubusercontent.com/u/47043427?v=4","gravatar_id":"","url":"https://api.github.com/users/Bastieno","html_url":"https://github.com/Bastieno","followers_url":"https://api.github.com/users/Bastieno/followers","following_url":"https://api.github.com/users/Bastieno/following{/other_user}","gists_url":"https://api.github.com/users/Bastieno/gists{/gist_id}","starred_url":"https://api.github.com/users/Bastieno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bastieno/subscriptions","organizations_url":"https://api.github.com/users/Bastieno/orgs","repos_url":"https://api.github.com/users/Bastieno/repos","events_url":"https://api.github.com/users/Bastieno/events{/privacy}","received_events_url":"https://api.github.com/users/Bastieno/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Bastieno/QuickCredit","description":"Quick Credit is an online lending platform that provides short term soft loans to individuals. This helps solve problems of financial inclusion as a way to alleviate poverty and empower low income earners.","fork":false,"url":"https://api.github.com/repos/Bastieno/QuickCredit","forks_url":"https://api.github.com/repos/Bastieno/QuickCredit/forks","keys_url":"https://api.github.com/repos/Bastieno/QuickCredit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Bastieno/QuickCredit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Bastieno/QuickCredit/teams","hooks_url":"https://api.github.com/repos/Bastieno/QuickCredit/hooks","issue_events_url":"https://api.github.com/repos/Bastieno/QuickCredit/issues/events{/number}","events_url":"https://api.github.com/repos/Bastieno/QuickCredit/events","assignees_url":"https://api.github.com/repos/Bastieno/QuickCredit/assignees{/user}","branches_url":"https://api.github.com/repos/Bastieno/QuickCredit/branches{/branch}","tags_url":"https://api.github.com/repos/Bastieno/QuickCredit/tags","blobs_url":"https://api.github.com/repos/Bastieno/QuickCredit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Bastieno/QuickCredit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Bastieno/QuickCredit/git/refs{/sha}","trees_url":"https://api.github.com/repos/Bastieno/QuickCredit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Bastieno/QuickCredit/statuses/{sha}","languages_url":"https://api.github.com/repos/Bastieno/QuickCredit/languages","stargazers_url":"https://api.github.com/repos/Bastieno/QuickCredit/stargazers","contributors_url":"https://api.github.com/repos/Bastieno/QuickCredit/contributors","subscribers_url":"https://api.github.com/repos/Bastieno/QuickCredit/subscribers","subscription_url":"https://api.github.com/repos/Bastieno/QuickCredit/subscription","commits_url":"https://api.github.com/repos/Bastieno/QuickCredit/commits{/sha}","git_commits_url":"https://api.github.com/repos/Bastieno/QuickCredit/git/commits{/sha}","comments_url":"https://api.github.com/repos/Bastieno/QuickCredit/comments{/number}","issue_comment_url":"https://api.github.com/repos/Bastieno/QuickCredit/issues/comments{/number}","contents_url":"https://api.github.com/repos/Bastieno/QuickCredit/contents/{+path}","compare_url":"https://api.github.com/repos/Bastieno/QuickCredit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Bastieno/QuickCredit/merges","archive_url":"https://api.github.com/repos/Bastieno/QuickCredit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Bastieno/QuickCredit/downloads","issues_url":"https://api.github.com/repos/Bastieno/QuickCredit/issues{/number}","pulls_url":"https://api.github.com/repos/Bastieno/QuickCredit/pulls{/number}","milestones_url":"https://api.github.com/repos/Bastieno/QuickCredit/milestones{/number}","notifications_url":"https://api.github.com/repos/Bastieno/QuickCredit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Bastieno/QuickCredit/labels{/name}","releases_url":"https://api.github.com/repos/Bastieno/QuickCredit/releases{/id}","deployments_url":"https://api.github.com/repos/Bastieno/QuickCredit/deployments","created_at":"2019-04-18T09:51:45Z","updated_at":"2019-05-21T10:55:01Z","pushed_at":"2019-05-23T06:20:44Z","git_url":"git://github.com/Bastieno/QuickCredit.git","ssh_url":"git@github.com:Bastieno/QuickCredit.git","clone_url":"https://github.com/Bastieno/QuickCredit.git","svn_url":"https://github.com/Bastieno/QuickCredit","homepage":"","size":969,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"Bastieno:develop","ref":"develop","sha":"10d4d727eea58f023dc53ea743ebb0183557f538","user":{"login":"Bastieno","id":47043427,"node_id":"MDQ6VXNlcjQ3MDQzNDI3","avatar_url":"https://avatars3.githubusercontent.com/u/47043427?v=4","gravatar_id":"","url":"https://api.github.com/users/Bastieno","html_url":"https://github.com/Bastieno","followers_url":"https://api.github.com/users/Bastieno/followers","following_url":"https://api.github.com/users/Bastieno/following{/other_user}","gists_url":"https://api.github.com/users/Bastieno/gists{/gist_id}","starred_url":"https://api.github.com/users/Bastieno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bastieno/subscriptions","organizations_url":"https://api.github.com/users/Bastieno/orgs","repos_url":"https://api.github.com/users/Bastieno/repos","events_url":"https://api.github.com/users/Bastieno/events{/privacy}","received_events_url":"https://api.github.com/users/Bastieno/received_events","type":"User","site_admin":false},"repo":{"id":182062076,"node_id":"MDEwOlJlcG9zaXRvcnkxODIwNjIwNzY=","name":"QuickCredit","full_name":"Bastieno/QuickCredit","private":false,"owner":{"login":"Bastieno","id":47043427,"node_id":"MDQ6VXNlcjQ3MDQzNDI3","avatar_url":"https://avatars3.githubusercontent.com/u/47043427?v=4","gravatar_id":"","url":"https://api.github.com/users/Bastieno","html_url":"https://github.com/Bastieno","followers_url":"https://api.github.com/users/Bastieno/followers","following_url":"https://api.github.com/users/Bastieno/following{/other_user}","gists_url":"https://api.github.com/users/Bastieno/gists{/gist_id}","starred_url":"https://api.github.com/users/Bastieno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bastieno/subscriptions","organizations_url":"https://api.github.com/users/Bastieno/orgs","repos_url":"https://api.github.com/users/Bastieno/repos","events_url":"https://api.github.com/users/Bastieno/events{/privacy}","received_events_url":"https://api.github.com/users/Bastieno/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Bastieno/QuickCredit","description":"Quick Credit is an online lending platform that provides short term soft loans to individuals. This helps solve problems of financial inclusion as a way to alleviate poverty and empower low income earners.","fork":false,"url":"https://api.github.com/repos/Bastieno/QuickCredit","forks_url":"https://api.github.com/repos/Bastieno/QuickCredit/forks","keys_url":"https://api.github.com/repos/Bastieno/QuickCredit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Bastieno/QuickCredit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Bastieno/QuickCredit/teams","hooks_url":"https://api.github.com/repos/Bastieno/QuickCredit/hooks","issue_events_url":"https://api.github.com/repos/Bastieno/QuickCredit/issues/events{/number}","events_url":"https://api.github.com/repos/Bastieno/QuickCredit/events","assignees_url":"https://api.github.com/repos/Bastieno/QuickCredit/assignees{/user}","branches_url":"https://api.github.com/repos/Bastieno/QuickCredit/branches{/branch}","tags_url":"https://api.github.com/repos/Bastieno/QuickCredit/tags","blobs_url":"https://api.github.com/repos/Bastieno/QuickCredit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Bastieno/QuickCredit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Bastieno/QuickCredit/git/refs{/sha}","trees_url":"https://api.github.com/repos/Bastieno/QuickCredit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Bastieno/QuickCredit/statuses/{sha}","languages_url":"https://api.github.com/repos/Bastieno/QuickCredit/languages","stargazers_url":"https://api.github.com/repos/Bastieno/QuickCredit/stargazers","contributors_url":"https://api.github.com/repos/Bastieno/QuickCredit/contributors","subscribers_url":"https://api.github.com/repos/Bastieno/QuickCredit/subscribers","subscription_url":"https://api.github.com/repos/Bastieno/QuickCredit/subscription","commits_url":"https://api.github.com/repos/Bastieno/QuickCredit/commits{/sha}","git_commits_url":"https://api.github.com/repos/Bastieno/QuickCredit/git/commits{/sha}","comments_url":"https://api.github.com/repos/Bastieno/QuickCredit/comments{/number}","issue_comment_url":"https://api.github.com/repos/Bastieno/QuickCredit/issues/comments{/number}","contents_url":"https://api.github.com/repos/Bastieno/QuickCredit/contents/{+path}","compare_url":"https://api.github.com/repos/Bastieno/QuickCredit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Bastieno/QuickCredit/merges","archive_url":"https://api.github.com/repos/Bastieno/QuickCredit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Bastieno/QuickCredit/downloads","issues_url":"https://api.github.com/repos/Bastieno/QuickCredit/issues{/number}","pulls_url":"https://api.github.com/repos/Bastieno/QuickCredit/pulls{/number}","milestones_url":"https://api.github.com/repos/Bastieno/QuickCredit/milestones{/number}","notifications_url":"https://api.github.com/repos/Bastieno/QuickCredit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Bastieno/QuickCredit/labels{/name}","releases_url":"https://api.github.com/repos/Bastieno/QuickCredit/releases{/id}","deployments_url":"https://api.github.com/repos/Bastieno/QuickCredit/deployments","created_at":"2019-04-18T09:51:45Z","updated_at":"2019-05-21T10:55:01Z","pushed_at":"2019-05-23T06:20:44Z","git_url":"git://github.com/Bastieno/QuickCredit.git","ssh_url":"git@github.com:Bastieno/QuickCredit.git","clone_url":"https://github.com/Bastieno/QuickCredit.git","svn_url":"https://github.com/Bastieno/QuickCredit","homepage":"","size":969,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Bastieno/QuickCredit/pulls/43"},"html":{"href":"https://github.com/Bastieno/QuickCredit/pull/43"},"issue":{"href":"https://api.github.com/repos/Bastieno/QuickCredit/issues/43"},"comments":{"href":"https://api.github.com/repos/Bastieno/QuickCredit/issues/43/comments"},"review_comments":{"href":"https://api.github.com/repos/Bastieno/QuickCredit/pulls/43/comments"},"review_comment":{"href":"https://api.github.com/repos/Bastieno/QuickCredit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Bastieno/QuickCredit/pulls/43/commits"},"statuses":{"href":"https://api.github.com/repos/Bastieno/QuickCredit/statuses/0b030ca650aa6e2e5b7eae8d6f509dc9a557659c"}},"author_association":"OWNER"}}
{"actor":{"display_login":"shegsteham"}}