{"action":"created","comment":{"url":"https://api.github.com/repos/WGillian/journey-planner-database/pulls/comments/169025986","pull_request_review_id":97485047,"id":169025986,"diff_hunk":"@@ -0,0 +1,8 @@\n+import config from '../config'\n+\n+export default (request, response) => {","path":"src/api/checkForToken.js","position":3,"original_position":3,"commit_id":"f0525143e08589bec1724ed52a73acab6e2d6af5","original_commit_id":"f0525143e08589bec1724ed52a73acab6e2d6af5","user":{"login":"richardgillzdev","id":26620259,"avatar_url":"https://avatars2.githubusercontent.com/u/26620259?v=4","gravatar_id":"","url":"https://api.github.com/users/richardgillzdev","html_url":"https://github.com/richardgillzdev","followers_url":"https://api.github.com/users/richardgillzdev/followers","following_url":"https://api.github.com/users/richardgillzdev/following{/other_user}","gists_url":"https://api.github.com/users/richardgillzdev/gists{/gist_id}","starred_url":"https://api.github.com/users/richardgillzdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardgillzdev/subscriptions","organizations_url":"https://api.github.com/users/richardgillzdev/orgs","repos_url":"https://api.github.com/users/richardgillzdev/repos","events_url":"https://api.github.com/users/richardgillzdev/events{/privacy}","received_events_url":"https://api.github.com/users/richardgillzdev/received_events","type":"User","site_admin":false},"body":"To make this even more modular I don't think this code should know about `request` or `response`, but should instead just take a token to check as an argument, and then returns whether or not the given token matches the one in config.","created_at":"2018-02-19T09:49:22Z","updated_at":"2018-02-19T09:49:22Z","html_url":"https://github.com/WGillian/journey-planner-database/pull/6#discussion_r169025986","pull_request_url":"https://api.github.com/repos/WGillian/journey-planner-database/pulls/6","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/WGillian/journey-planner-database/pulls/comments/169025986"},"html":{"href":"https://github.com/WGillian/journey-planner-database/pull/6#discussion_r169025986"},"pull_request":{"href":"https://api.github.com/repos/WGillian/journey-planner-database/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/WGillian/journey-planner-database/pulls/6","id":169650779,"html_url":"https://github.com/WGillian/journey-planner-database/pull/6","diff_url":"https://github.com/WGillian/journey-planner-database/pull/6.diff","patch_url":"https://github.com/WGillian/journey-planner-database/pull/6.patch","issue_url":"https://api.github.com/repos/WGillian/journey-planner-database/issues/6","number":6,"state":"open","locked":false,"title":"Dried up the backend","user":{"login":"WGillian","id":33250097,"avatar_url":"https://avatars3.githubusercontent.com/u/33250097?v=4","gravatar_id":"","url":"https://api.github.com/users/WGillian","html_url":"https://github.com/WGillian","followers_url":"https://api.github.com/users/WGillian/followers","following_url":"https://api.github.com/users/WGillian/following{/other_user}","gists_url":"https://api.github.com/users/WGillian/gists{/gist_id}","starred_url":"https://api.github.com/users/WGillian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WGillian/subscriptions","organizations_url":"https://api.github.com/users/WGillian/orgs","repos_url":"https://api.github.com/users/WGillian/repos","events_url":"https://api.github.com/users/WGillian/events{/privacy}","received_events_url":"https://api.github.com/users/WGillian/received_events","type":"User","site_admin":false},"body":"The actions for adding, updating, and deleting a trip contained much of the same code. I've pulled the checking for token, checking that user account exists and the `fs.readFile` and `fs.writeFile` parts out into their own file to make backend more DRY","created_at":"2018-02-16T15:23:04Z","updated_at":"2018-02-19T09:49:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b67f9dd37e010df099d9013ce335509f7c380e77","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/WGillian/journey-planner-database/pulls/6/commits","review_comments_url":"https://api.github.com/repos/WGillian/journey-planner-database/pulls/6/comments","review_comment_url":"https://api.github.com/repos/WGillian/journey-planner-database/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WGillian/journey-planner-database/issues/6/comments","statuses_url":"https://api.github.com/repos/WGillian/journey-planner-database/statuses/f0525143e08589bec1724ed52a73acab6e2d6af5","head":{"label":"WGillian:DRY","ref":"DRY","sha":"f0525143e08589bec1724ed52a73acab6e2d6af5","user":{"login":"WGillian","id":33250097,"avatar_url":"https://avatars3.githubusercontent.com/u/33250097?v=4","gravatar_id":"","url":"https://api.github.com/users/WGillian","html_url":"https://github.com/WGillian","followers_url":"https://api.github.com/users/WGillian/followers","following_url":"https://api.github.com/users/WGillian/following{/other_user}","gists_url":"https://api.github.com/users/WGillian/gists{/gist_id}","starred_url":"https://api.github.com/users/WGillian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WGillian/subscriptions","organizations_url":"https://api.github.com/users/WGillian/orgs","repos_url":"https://api.github.com/users/WGillian/repos","events_url":"https://api.github.com/users/WGillian/events{/privacy}","received_events_url":"https://api.github.com/users/WGillian/received_events","type":"User","site_admin":false},"repo":{"id":120458403,"name":"journey-planner-database","full_name":"WGillian/journey-planner-database","owner":{"login":"WGillian","id":33250097,"avatar_url":"https://avatars3.githubusercontent.com/u/33250097?v=4","gravatar_id":"","url":"https://api.github.com/users/WGillian","html_url":"https://github.com/WGillian","followers_url":"https://api.github.com/users/WGillian/followers","following_url":"https://api.github.com/users/WGillian/following{/other_user}","gists_url":"https://api.github.com/users/WGillian/gists{/gist_id}","starred_url":"https://api.github.com/users/WGillian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WGillian/subscriptions","organizations_url":"https://api.github.com/users/WGillian/orgs","repos_url":"https://api.github.com/users/WGillian/repos","events_url":"https://api.github.com/users/WGillian/events{/privacy}","received_events_url":"https://api.github.com/users/WGillian/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/WGillian/journey-planner-database","description":null,"fork":false,"url":"https://api.github.com/repos/WGillian/journey-planner-database","forks_url":"https://api.github.com/repos/WGillian/journey-planner-database/forks","keys_url":"https://api.github.com/repos/WGillian/journey-planner-database/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WGillian/journey-planner-database/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WGillian/journey-planner-database/teams","hooks_url":"https://api.github.com/repos/WGillian/journey-planner-database/hooks","issue_events_url":"https://api.github.com/repos/WGillian/journey-planner-database/issues/events{/number}","events_url":"https://api.github.com/repos/WGillian/journey-planner-database/events","assignees_url":"https://api.github.com/repos/WGillian/journey-planner-database/assignees{/user}","branches_url":"https://api.github.com/repos/WGillian/journey-planner-database/branches{/branch}","tags_url":"https://api.github.com/repos/WGillian/journey-planner-database/tags","blobs_url":"https://api.github.com/repos/WGillian/journey-planner-database/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WGillian/journey-planner-database/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WGillian/journey-planner-database/git/refs{/sha}","trees_url":"https://api.github.com/repos/WGillian/journey-planner-database/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WGillian/journey-planner-database/statuses/{sha}","languages_url":"https://api.github.com/repos/WGillian/journey-planner-database/languages","stargazers_url":"https://api.github.com/repos/WGillian/journey-planner-database/stargazers","contributors_url":"https://api.github.com/repos/WGillian/journey-planner-database/contributors","subscribers_url":"https://api.github.com/repos/WGillian/journey-planner-database/subscribers","subscription_url":"https://api.github.com/repos/WGillian/journey-planner-database/subscription","commits_url":"https://api.github.com/repos/WGillian/journey-planner-database/commits{/sha}","git_commits_url":"https://api.github.com/repos/WGillian/journey-planner-database/git/commits{/sha}","comments_url":"https://api.github.com/repos/WGillian/journey-planner-database/comments{/number}","issue_comment_url":"https://api.github.com/repos/WGillian/journey-planner-database/issues/comments{/number}","contents_url":"https://api.github.com/repos/WGillian/journey-planner-database/contents/{+path}","compare_url":"https://api.github.com/repos/WGillian/journey-planner-database/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WGillian/journey-planner-database/merges","archive_url":"https://api.github.com/repos/WGillian/journey-planner-database/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WGillian/journey-planner-database/downloads","issues_url":"https://api.github.com/repos/WGillian/journey-planner-database/issues{/number}","pulls_url":"https://api.github.com/repos/WGillian/journey-planner-database/pulls{/number}","milestones_url":"https://api.github.com/repos/WGillian/journey-planner-database/milestones{/number}","notifications_url":"https://api.github.com/repos/WGillian/journey-planner-database/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WGillian/journey-planner-database/labels{/name}","releases_url":"https://api.github.com/repos/WGillian/journey-planner-database/releases{/id}","deployments_url":"https://api.github.com/repos/WGillian/journey-planner-database/deployments","created_at":"2018-02-06T13:11:04Z","updated_at":"2018-02-06T13:12:39Z","pushed_at":"2018-02-19T09:32:18Z","git_url":"git://github.com/WGillian/journey-planner-database.git","ssh_url":"git@github.com:WGillian/journey-planner-database.git","clone_url":"https://github.com/WGillian/journey-planner-database.git","svn_url":"https://github.com/WGillian/journey-planner-database","homepage":null,"size":124,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"WGillian:master","ref":"master","sha":"4c3143a375a6afaa75808d7784a0e8322eb80e7e","user":{"login":"WGillian","id":33250097,"avatar_url":"https://avatars3.githubusercontent.com/u/33250097?v=4","gravatar_id":"","url":"https://api.github.com/users/WGillian","html_url":"https://github.com/WGillian","followers_url":"https://api.github.com/users/WGillian/followers","following_url":"https://api.github.com/users/WGillian/following{/other_user}","gists_url":"https://api.github.com/users/WGillian/gists{/gist_id}","starred_url":"https://api.github.com/users/WGillian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WGillian/subscriptions","organizations_url":"https://api.github.com/users/WGillian/orgs","repos_url":"https://api.github.com/users/WGillian/repos","events_url":"https://api.github.com/users/WGillian/events{/privacy}","received_events_url":"https://api.github.com/users/WGillian/received_events","type":"User","site_admin":false},"repo":{"id":120458403,"name":"journey-planner-database","full_name":"WGillian/journey-planner-database","owner":{"login":"WGillian","id":33250097,"avatar_url":"https://avatars3.githubusercontent.com/u/33250097?v=4","gravatar_id":"","url":"https://api.github.com/users/WGillian","html_url":"https://github.com/WGillian","followers_url":"https://api.github.com/users/WGillian/followers","following_url":"https://api.github.com/users/WGillian/following{/other_user}","gists_url":"https://api.github.com/users/WGillian/gists{/gist_id}","starred_url":"https://api.github.com/users/WGillian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WGillian/subscriptions","organizations_url":"https://api.github.com/users/WGillian/orgs","repos_url":"https://api.github.com/users/WGillian/repos","events_url":"https://api.github.com/users/WGillian/events{/privacy}","received_events_url":"https://api.github.com/users/WGillian/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/WGillian/journey-planner-database","description":null,"fork":false,"url":"https://api.github.com/repos/WGillian/journey-planner-database","forks_url":"https://api.github.com/repos/WGillian/journey-planner-database/forks","keys_url":"https://api.github.com/repos/WGillian/journey-planner-database/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WGillian/journey-planner-database/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WGillian/journey-planner-database/teams","hooks_url":"https://api.github.com/repos/WGillian/journey-planner-database/hooks","issue_events_url":"https://api.github.com/repos/WGillian/journey-planner-database/issues/events{/number}","events_url":"https://api.github.com/repos/WGillian/journey-planner-database/events","assignees_url":"https://api.github.com/repos/WGillian/journey-planner-database/assignees{/user}","branches_url":"https://api.github.com/repos/WGillian/journey-planner-database/branches{/branch}","tags_url":"https://api.github.com/repos/WGillian/journey-planner-database/tags","blobs_url":"https://api.github.com/repos/WGillian/journey-planner-database/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WGillian/journey-planner-database/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WGillian/journey-planner-database/git/refs{/sha}","trees_url":"https://api.github.com/repos/WGillian/journey-planner-database/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WGillian/journey-planner-database/statuses/{sha}","languages_url":"https://api.github.com/repos/WGillian/journey-planner-database/languages","stargazers_url":"https://api.github.com/repos/WGillian/journey-planner-database/stargazers","contributors_url":"https://api.github.com/repos/WGillian/journey-planner-database/contributors","subscribers_url":"https://api.github.com/repos/WGillian/journey-planner-database/subscribers","subscription_url":"https://api.github.com/repos/WGillian/journey-planner-database/subscription","commits_url":"https://api.github.com/repos/WGillian/journey-planner-database/commits{/sha}","git_commits_url":"https://api.github.com/repos/WGillian/journey-planner-database/git/commits{/sha}","comments_url":"https://api.github.com/repos/WGillian/journey-planner-database/comments{/number}","issue_comment_url":"https://api.github.com/repos/WGillian/journey-planner-database/issues/comments{/number}","contents_url":"https://api.github.com/repos/WGillian/journey-planner-database/contents/{+path}","compare_url":"https://api.github.com/repos/WGillian/journey-planner-database/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WGillian/journey-planner-database/merges","archive_url":"https://api.github.com/repos/WGillian/journey-planner-database/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WGillian/journey-planner-database/downloads","issues_url":"https://api.github.com/repos/WGillian/journey-planner-database/issues{/number}","pulls_url":"https://api.github.com/repos/WGillian/journey-planner-database/pulls{/number}","milestones_url":"https://api.github.com/repos/WGillian/journey-planner-database/milestones{/number}","notifications_url":"https://api.github.com/repos/WGillian/journey-planner-database/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WGillian/journey-planner-database/labels{/name}","releases_url":"https://api.github.com/repos/WGillian/journey-planner-database/releases{/id}","deployments_url":"https://api.github.com/repos/WGillian/journey-planner-database/deployments","created_at":"2018-02-06T13:11:04Z","updated_at":"2018-02-06T13:12:39Z","pushed_at":"2018-02-19T09:32:18Z","git_url":"git://github.com/WGillian/journey-planner-database.git","ssh_url":"git@github.com:WGillian/journey-planner-database.git","clone_url":"https://github.com/WGillian/journey-planner-database.git","svn_url":"https://github.com/WGillian/journey-planner-database","homepage":null,"size":124,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WGillian/journey-planner-database/pulls/6"},"html":{"href":"https://github.com/WGillian/journey-planner-database/pull/6"},"issue":{"href":"https://api.github.com/repos/WGillian/journey-planner-database/issues/6"},"comments":{"href":"https://api.github.com/repos/WGillian/journey-planner-database/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/WGillian/journey-planner-database/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/WGillian/journey-planner-database/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WGillian/journey-planner-database/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/WGillian/journey-planner-database/statuses/f0525143e08589bec1724ed52a73acab6e2d6af5"}},"author_association":"OWNER"}}
{"actor":{"display_login":"richardgillzdev"}}