{"action":"created","comment":{"url":"https://api.github.com/repos/nickjaz/parkify/pulls/comments/132731875","pull_request_review_id":55847345,"id":132731875,"diff_hunk":"@@ -0,0 +1,49 @@\n+'use strict';\n+\n+const Router = require('express').Router;\n+const jsonParser = require('body-parser').json();\n+const createError = require('http-errors');\n+const debug = require('debug')('parkify:car-router');\n+\n+const bearerAuth = require('../lib/bearer-auth-middleware.js');\n+const Car = require('../model/car.js');\n+\n+const carRouter = module.exports = Router();\n+\n+carRouter.post('/api/car/:carID', bearerAuth, jsonParser, function(request, response, next) {\n+  debug('POST: /api/car/:carID');\n+\n+  if (Object.keys(request.body).length === 0) return next(createError(400, 'Bad Request'));\n+\n+  request.body.userID = request.user._id;\n+\n+  new Car(request.body).save()\n+  .then( car => response.json(car))\n+  .catch(next);\n+});\n+\n+carRouter.get('/api/car/:carID', bearerAuth, function(request, response, next) {\n+  debug('GET: /api/car/:carID');\n+\n+  Car.findById(request.params.id)\n+  .then( car => response.json(car))","path":"route/car-router.js","position":29,"original_position":29,"commit_id":"96198baf841af7fe2b6c904d1f1515cfdc3575da","original_commit_id":"96198baf841af7fe2b6c904d1f1515cfdc3575da","user":{"login":"nharren","id":11601619,"avatar_url":"https://avatars0.githubusercontent.com/u/11601619?v=4","gravatar_id":"","url":"https://api.github.com/users/nharren","html_url":"https://github.com/nharren","followers_url":"https://api.github.com/users/nharren/followers","following_url":"https://api.github.com/users/nharren/following{/other_user}","gists_url":"https://api.github.com/users/nharren/gists{/gist_id}","starred_url":"https://api.github.com/users/nharren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nharren/subscriptions","organizations_url":"https://api.github.com/users/nharren/orgs","repos_url":"https://api.github.com/users/nharren/repos","events_url":"https://api.github.com/users/nharren/events{/privacy}","received_events_url":"https://api.github.com/users/nharren/received_events","type":"User","site_admin":false},"body":"We'll have to check later on with tests, but I think when the car can't be found it won't error out, it will just return an undefined car. ","created_at":"2017-08-11T16:44:00Z","updated_at":"2017-08-11T16:44:40Z","html_url":"https://github.com/nickjaz/parkify/pull/17#discussion_r132731875","pull_request_url":"https://api.github.com/repos/nickjaz/parkify/pulls/17","_links":{"self":{"href":"https://api.github.com/repos/nickjaz/parkify/pulls/comments/132731875"},"html":{"href":"https://github.com/nickjaz/parkify/pull/17#discussion_r132731875"},"pull_request":{"href":"https://api.github.com/repos/nickjaz/parkify/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/nickjaz/parkify/pulls/17","id":135365085,"html_url":"https://github.com/nickjaz/parkify/pull/17","diff_url":"https://github.com/nickjaz/parkify/pull/17.diff","patch_url":"https://github.com/nickjaz/parkify/pull/17.patch","issue_url":"https://api.github.com/repos/nickjaz/parkify/issues/17","number":17,"state":"open","locked":false,"title":"Adds CRUD Routes","user":{"login":"ohjonah","id":9189867,"avatar_url":"https://avatars1.githubusercontent.com/u/9189867?v=4","gravatar_id":"","url":"https://api.github.com/users/ohjonah","html_url":"https://github.com/ohjonah","followers_url":"https://api.github.com/users/ohjonah/followers","following_url":"https://api.github.com/users/ohjonah/following{/other_user}","gists_url":"https://api.github.com/users/ohjonah/gists{/gist_id}","starred_url":"https://api.github.com/users/ohjonah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ohjonah/subscriptions","organizations_url":"https://api.github.com/users/ohjonah/orgs","repos_url":"https://api.github.com/users/ohjonah/repos","events_url":"https://api.github.com/users/ohjonah/events{/privacy}","received_events_url":"https://api.github.com/users/ohjonah/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-08-11T15:48:14Z","updated_at":"2017-08-11T16:44:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f364b5bb27640935014e5eaba4f21fc3d3f38291","assignee":null,"assignees":[],"requested_reviewers":[{"login":"sharmarkei","id":19905144,"avatar_url":"https://avatars2.githubusercontent.com/u/19905144?v=4","gravatar_id":"","url":"https://api.github.com/users/sharmarkei","html_url":"https://github.com/sharmarkei","followers_url":"https://api.github.com/users/sharmarkei/followers","following_url":"https://api.github.com/users/sharmarkei/following{/other_user}","gists_url":"https://api.github.com/users/sharmarkei/gists{/gist_id}","starred_url":"https://api.github.com/users/sharmarkei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharmarkei/subscriptions","organizations_url":"https://api.github.com/users/sharmarkei/orgs","repos_url":"https://api.github.com/users/sharmarkei/repos","events_url":"https://api.github.com/users/sharmarkei/events{/privacy}","received_events_url":"https://api.github.com/users/sharmarkei/received_events","type":"User","site_admin":false},{"login":"ragnaroksedge","id":20917702,"avatar_url":"https://avatars1.githubusercontent.com/u/20917702?v=4","gravatar_id":"","url":"https://api.github.com/users/ragnaroksedge","html_url":"https://github.com/ragnaroksedge","followers_url":"https://api.github.com/users/ragnaroksedge/followers","following_url":"https://api.github.com/users/ragnaroksedge/following{/other_user}","gists_url":"https://api.github.com/users/ragnaroksedge/gists{/gist_id}","starred_url":"https://api.github.com/users/ragnaroksedge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ragnaroksedge/subscriptions","organizations_url":"https://api.github.com/users/ragnaroksedge/orgs","repos_url":"https://api.github.com/users/ragnaroksedge/repos","events_url":"https://api.github.com/users/ragnaroksedge/events{/privacy}","received_events_url":"https://api.github.com/users/ragnaroksedge/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/nickjaz/parkify/pulls/17/commits","review_comments_url":"https://api.github.com/repos/nickjaz/parkify/pulls/17/comments","review_comment_url":"https://api.github.com/repos/nickjaz/parkify/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nickjaz/parkify/issues/17/comments","statuses_url":"https://api.github.com/repos/nickjaz/parkify/statuses/96198baf841af7fe2b6c904d1f1515cfdc3575da","head":{"label":"nickjaz:feature/car-router","ref":"feature/car-router","sha":"96198baf841af7fe2b6c904d1f1515cfdc3575da","user":{"login":"nickjaz","id":22438466,"avatar_url":"https://avatars2.githubusercontent.com/u/22438466?v=4","gravatar_id":"","url":"https://api.github.com/users/nickjaz","html_url":"https://github.com/nickjaz","followers_url":"https://api.github.com/users/nickjaz/followers","following_url":"https://api.github.com/users/nickjaz/following{/other_user}","gists_url":"https://api.github.com/users/nickjaz/gists{/gist_id}","starred_url":"https://api.github.com/users/nickjaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickjaz/subscriptions","organizations_url":"https://api.github.com/users/nickjaz/orgs","repos_url":"https://api.github.com/users/nickjaz/repos","events_url":"https://api.github.com/users/nickjaz/events{/privacy}","received_events_url":"https://api.github.com/users/nickjaz/received_events","type":"User","site_admin":false},"repo":{"id":99962473,"name":"parkify","full_name":"nickjaz/parkify","owner":{"login":"nickjaz","id":22438466,"avatar_url":"https://avatars2.githubusercontent.com/u/22438466?v=4","gravatar_id":"","url":"https://api.github.com/users/nickjaz","html_url":"https://github.com/nickjaz","followers_url":"https://api.github.com/users/nickjaz/followers","following_url":"https://api.github.com/users/nickjaz/following{/other_user}","gists_url":"https://api.github.com/users/nickjaz/gists{/gist_id}","starred_url":"https://api.github.com/users/nickjaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickjaz/subscriptions","organizations_url":"https://api.github.com/users/nickjaz/orgs","repos_url":"https://api.github.com/users/nickjaz/repos","events_url":"https://api.github.com/users/nickjaz/events{/privacy}","received_events_url":"https://api.github.com/users/nickjaz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nickjaz/parkify","description":"air bnb for parking spaces","fork":false,"url":"https://api.github.com/repos/nickjaz/parkify","forks_url":"https://api.github.com/repos/nickjaz/parkify/forks","keys_url":"https://api.github.com/repos/nickjaz/parkify/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nickjaz/parkify/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nickjaz/parkify/teams","hooks_url":"https://api.github.com/repos/nickjaz/parkify/hooks","issue_events_url":"https://api.github.com/repos/nickjaz/parkify/issues/events{/number}","events_url":"https://api.github.com/repos/nickjaz/parkify/events","assignees_url":"https://api.github.com/repos/nickjaz/parkify/assignees{/user}","branches_url":"https://api.github.com/repos/nickjaz/parkify/branches{/branch}","tags_url":"https://api.github.com/repos/nickjaz/parkify/tags","blobs_url":"https://api.github.com/repos/nickjaz/parkify/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nickjaz/parkify/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nickjaz/parkify/git/refs{/sha}","trees_url":"https://api.github.com/repos/nickjaz/parkify/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nickjaz/parkify/statuses/{sha}","languages_url":"https://api.github.com/repos/nickjaz/parkify/languages","stargazers_url":"https://api.github.com/repos/nickjaz/parkify/stargazers","contributors_url":"https://api.github.com/repos/nickjaz/parkify/contributors","subscribers_url":"https://api.github.com/repos/nickjaz/parkify/subscribers","subscription_url":"https://api.github.com/repos/nickjaz/parkify/subscription","commits_url":"https://api.github.com/repos/nickjaz/parkify/commits{/sha}","git_commits_url":"https://api.github.com/repos/nickjaz/parkify/git/commits{/sha}","comments_url":"https://api.github.com/repos/nickjaz/parkify/comments{/number}","issue_comment_url":"https://api.github.com/repos/nickjaz/parkify/issues/comments{/number}","contents_url":"https://api.github.com/repos/nickjaz/parkify/contents/{+path}","compare_url":"https://api.github.com/repos/nickjaz/parkify/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nickjaz/parkify/merges","archive_url":"https://api.github.com/repos/nickjaz/parkify/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nickjaz/parkify/downloads","issues_url":"https://api.github.com/repos/nickjaz/parkify/issues{/number}","pulls_url":"https://api.github.com/repos/nickjaz/parkify/pulls{/number}","milestones_url":"https://api.github.com/repos/nickjaz/parkify/milestones{/number}","notifications_url":"https://api.github.com/repos/nickjaz/parkify/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nickjaz/parkify/labels{/name}","releases_url":"https://api.github.com/repos/nickjaz/parkify/releases{/id}","deployments_url":"https://api.github.com/repos/nickjaz/parkify/deployments","created_at":"2017-08-10T20:31:23Z","updated_at":"2017-08-10T21:14:13Z","pushed_at":"2017-08-11T16:40:55Z","git_url":"git://github.com/nickjaz/parkify.git","ssh_url":"git@github.com:nickjaz/parkify.git","clone_url":"https://github.com/nickjaz/parkify.git","svn_url":"https://github.com/nickjaz/parkify","homepage":null,"size":22,"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,"open_issues_count":13,"forks":0,"open_issues":13,"watchers":0,"default_branch":"staging"}},"base":{"label":"nickjaz:staging","ref":"staging","sha":"e449ea26067ef7982436fcc5b64ba96a31b7639e","user":{"login":"nickjaz","id":22438466,"avatar_url":"https://avatars2.githubusercontent.com/u/22438466?v=4","gravatar_id":"","url":"https://api.github.com/users/nickjaz","html_url":"https://github.com/nickjaz","followers_url":"https://api.github.com/users/nickjaz/followers","following_url":"https://api.github.com/users/nickjaz/following{/other_user}","gists_url":"https://api.github.com/users/nickjaz/gists{/gist_id}","starred_url":"https://api.github.com/users/nickjaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickjaz/subscriptions","organizations_url":"https://api.github.com/users/nickjaz/orgs","repos_url":"https://api.github.com/users/nickjaz/repos","events_url":"https://api.github.com/users/nickjaz/events{/privacy}","received_events_url":"https://api.github.com/users/nickjaz/received_events","type":"User","site_admin":false},"repo":{"id":99962473,"name":"parkify","full_name":"nickjaz/parkify","owner":{"login":"nickjaz","id":22438466,"avatar_url":"https://avatars2.githubusercontent.com/u/22438466?v=4","gravatar_id":"","url":"https://api.github.com/users/nickjaz","html_url":"https://github.com/nickjaz","followers_url":"https://api.github.com/users/nickjaz/followers","following_url":"https://api.github.com/users/nickjaz/following{/other_user}","gists_url":"https://api.github.com/users/nickjaz/gists{/gist_id}","starred_url":"https://api.github.com/users/nickjaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickjaz/subscriptions","organizations_url":"https://api.github.com/users/nickjaz/orgs","repos_url":"https://api.github.com/users/nickjaz/repos","events_url":"https://api.github.com/users/nickjaz/events{/privacy}","received_events_url":"https://api.github.com/users/nickjaz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nickjaz/parkify","description":"air bnb for parking spaces","fork":false,"url":"https://api.github.com/repos/nickjaz/parkify","forks_url":"https://api.github.com/repos/nickjaz/parkify/forks","keys_url":"https://api.github.com/repos/nickjaz/parkify/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nickjaz/parkify/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nickjaz/parkify/teams","hooks_url":"https://api.github.com/repos/nickjaz/parkify/hooks","issue_events_url":"https://api.github.com/repos/nickjaz/parkify/issues/events{/number}","events_url":"https://api.github.com/repos/nickjaz/parkify/events","assignees_url":"https://api.github.com/repos/nickjaz/parkify/assignees{/user}","branches_url":"https://api.github.com/repos/nickjaz/parkify/branches{/branch}","tags_url":"https://api.github.com/repos/nickjaz/parkify/tags","blobs_url":"https://api.github.com/repos/nickjaz/parkify/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nickjaz/parkify/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nickjaz/parkify/git/refs{/sha}","trees_url":"https://api.github.com/repos/nickjaz/parkify/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nickjaz/parkify/statuses/{sha}","languages_url":"https://api.github.com/repos/nickjaz/parkify/languages","stargazers_url":"https://api.github.com/repos/nickjaz/parkify/stargazers","contributors_url":"https://api.github.com/repos/nickjaz/parkify/contributors","subscribers_url":"https://api.github.com/repos/nickjaz/parkify/subscribers","subscription_url":"https://api.github.com/repos/nickjaz/parkify/subscription","commits_url":"https://api.github.com/repos/nickjaz/parkify/commits{/sha}","git_commits_url":"https://api.github.com/repos/nickjaz/parkify/git/commits{/sha}","comments_url":"https://api.github.com/repos/nickjaz/parkify/comments{/number}","issue_comment_url":"https://api.github.com/repos/nickjaz/parkify/issues/comments{/number}","contents_url":"https://api.github.com/repos/nickjaz/parkify/contents/{+path}","compare_url":"https://api.github.com/repos/nickjaz/parkify/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nickjaz/parkify/merges","archive_url":"https://api.github.com/repos/nickjaz/parkify/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nickjaz/parkify/downloads","issues_url":"https://api.github.com/repos/nickjaz/parkify/issues{/number}","pulls_url":"https://api.github.com/repos/nickjaz/parkify/pulls{/number}","milestones_url":"https://api.github.com/repos/nickjaz/parkify/milestones{/number}","notifications_url":"https://api.github.com/repos/nickjaz/parkify/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nickjaz/parkify/labels{/name}","releases_url":"https://api.github.com/repos/nickjaz/parkify/releases{/id}","deployments_url":"https://api.github.com/repos/nickjaz/parkify/deployments","created_at":"2017-08-10T20:31:23Z","updated_at":"2017-08-10T21:14:13Z","pushed_at":"2017-08-11T16:40:55Z","git_url":"git://github.com/nickjaz/parkify.git","ssh_url":"git@github.com:nickjaz/parkify.git","clone_url":"https://github.com/nickjaz/parkify.git","svn_url":"https://github.com/nickjaz/parkify","homepage":null,"size":22,"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,"open_issues_count":13,"forks":0,"open_issues":13,"watchers":0,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/nickjaz/parkify/pulls/17"},"html":{"href":"https://github.com/nickjaz/parkify/pull/17"},"issue":{"href":"https://api.github.com/repos/nickjaz/parkify/issues/17"},"comments":{"href":"https://api.github.com/repos/nickjaz/parkify/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/nickjaz/parkify/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/nickjaz/parkify/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nickjaz/parkify/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/nickjaz/parkify/statuses/96198baf841af7fe2b6c904d1f1515cfdc3575da"}}}}
{"actor":{"display_login":"nharren"}}