{"action":"created","comment":{"url":"https://api.github.com/repos/leilabl/stackstore/pulls/comments/54916136","id":54916136,"diff_hunk":"@@ -0,0 +1,102 @@\n+var express = require('express');\n+var router = express.Router();\n+var mongoose = require('mongoose')\n+\n+router.get('/', function(req, res) {\n+\tmongoose.model('Wine')\n+\t.find({})\n+\t.then(function(wines) {\n+\t\tres.json(wines)\n+\t})\n+\t.then(null, function(err) {\n+\t\tconsole.log(err)\n+\t})\n+})\n+\n+router.get('/:id', function(req, res) {\n+\tvar id = req.params.id\n+\tmongoose.model('Wine')\n+\t.findById(id)\n+\t.then(function(wine) {\n+\t\tres.json(wine)\n+\t})\n+\t.then(null, function(err) {\n+\t\tconsole.log(err)\n+\t\tres.sendStatus(404)\n+\t})\n+})\n+\n+router.get('/:id/reviews', function(req, res) {\n+\tvar id = req.params.id\n+\tmongoose.model('Wine')\n+\t.findById(id)\n+\t.then(function(wine) {\n+\t\twine.findReviews()\n+\t})\n+\t.then(function(reviews) {\n+\t\tres.json(reviews)\n+\t})\n+\t.then(null, function(err) {\n+\t\tconsole.log(err)\n+\t\tres.sendStatus(404)\n+\t})\n+})\n+\n+router.get('/:id/rating', function(req, res) {\n+\tvar id = req.params.id\n+\tmongoose.model('Wine')\n+\t.findById(id)\n+\t.then(function(wine) {\n+\t\twine.findRating()\n+\t})\n+\t.then(function(rating) {\n+\t\tres.json(rating)\n+\t})\n+\t.then(null, function(err) {\n+\t\tconsole.log(err)\n+\t\tres.sendStatus(404)\n+\t})\n+})\n+\n+router.post('/', function(req, res) {\n+\tmongoose.model('Wine')\n+\t.create(req.body)","path":"server/app/routes/api/wines.js","position":63,"original_position":63,"commit_id":"ffd99c265e1368cd77c552aa024dad491ca7878b","original_commit_id":"ffd99c265e1368cd77c552aa024dad491ca7878b","user":{"login":"pdpatel2","id":16145582,"avatar_url":"https://avatars.githubusercontent.com/u/16145582?v=3","gravatar_id":"","url":"https://api.github.com/users/pdpatel2","html_url":"https://github.com/pdpatel2","followers_url":"https://api.github.com/users/pdpatel2/followers","following_url":"https://api.github.com/users/pdpatel2/following{/other_user}","gists_url":"https://api.github.com/users/pdpatel2/gists{/gist_id}","starred_url":"https://api.github.com/users/pdpatel2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdpatel2/subscriptions","organizations_url":"https://api.github.com/users/pdpatel2/orgs","repos_url":"https://api.github.com/users/pdpatel2/repos","events_url":"https://api.github.com/users/pdpatel2/events{/privacy}","received_events_url":"https://api.github.com/users/pdpatel2/received_events","type":"User","site_admin":false},"body":"duplicate wine posts? Only admins should really be able to post wines. I'll leave a comment in there for now so we can remember to address later on, if needed. ","created_at":"2016-03-03T17:35:36Z","updated_at":"2016-03-03T17:35:36Z","html_url":"https://github.com/leilabl/stackstore/pull/44#discussion_r54916136","pull_request_url":"https://api.github.com/repos/leilabl/stackstore/pulls/44","_links":{"self":{"href":"https://api.github.com/repos/leilabl/stackstore/pulls/comments/54916136"},"html":{"href":"https://github.com/leilabl/stackstore/pull/44#discussion_r54916136"},"pull_request":{"href":"https://api.github.com/repos/leilabl/stackstore/pulls/44"}}},"pull_request":{"url":"https://api.github.com/repos/leilabl/stackstore/pulls/44","id":61484378,"html_url":"https://github.com/leilabl/stackstore/pull/44","diff_url":"https://github.com/leilabl/stackstore/pull/44.diff","patch_url":"https://github.com/leilabl/stackstore/pull/44.patch","issue_url":"https://api.github.com/repos/leilabl/stackstore/issues/44","number":44,"state":"open","locked":false,"title":"Wine routes","user":{"login":"pdpatel2","id":16145582,"avatar_url":"https://avatars.githubusercontent.com/u/16145582?v=3","gravatar_id":"","url":"https://api.github.com/users/pdpatel2","html_url":"https://github.com/pdpatel2","followers_url":"https://api.github.com/users/pdpatel2/followers","following_url":"https://api.github.com/users/pdpatel2/following{/other_user}","gists_url":"https://api.github.com/users/pdpatel2/gists{/gist_id}","starred_url":"https://api.github.com/users/pdpatel2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdpatel2/subscriptions","organizations_url":"https://api.github.com/users/pdpatel2/orgs","repos_url":"https://api.github.com/users/pdpatel2/repos","events_url":"https://api.github.com/users/pdpatel2/events{/privacy}","received_events_url":"https://api.github.com/users/pdpatel2/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-02T23:14:28Z","updated_at":"2016-03-03T17:35:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2ebad858ee9cfa3411e75a0634c3170f06bc3675","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/leilabl/stackstore/pulls/44/commits","review_comments_url":"https://api.github.com/repos/leilabl/stackstore/pulls/44/comments","review_comment_url":"https://api.github.com/repos/leilabl/stackstore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/leilabl/stackstore/issues/44/comments","statuses_url":"https://api.github.com/repos/leilabl/stackstore/statuses/ffd99c265e1368cd77c552aa024dad491ca7878b","head":{"label":"leilabl:wineRoutes","ref":"wineRoutes","sha":"ffd99c265e1368cd77c552aa024dad491ca7878b","user":{"login":"leilabl","id":11221406,"avatar_url":"https://avatars.githubusercontent.com/u/11221406?v=3","gravatar_id":"","url":"https://api.github.com/users/leilabl","html_url":"https://github.com/leilabl","followers_url":"https://api.github.com/users/leilabl/followers","following_url":"https://api.github.com/users/leilabl/following{/other_user}","gists_url":"https://api.github.com/users/leilabl/gists{/gist_id}","starred_url":"https://api.github.com/users/leilabl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leilabl/subscriptions","organizations_url":"https://api.github.com/users/leilabl/orgs","repos_url":"https://api.github.com/users/leilabl/repos","events_url":"https://api.github.com/users/leilabl/events{/privacy}","received_events_url":"https://api.github.com/users/leilabl/received_events","type":"User","site_admin":false},"repo":{"id":52811375,"name":"stackstore","full_name":"leilabl/stackstore","owner":{"login":"leilabl","id":11221406,"avatar_url":"https://avatars.githubusercontent.com/u/11221406?v=3","gravatar_id":"","url":"https://api.github.com/users/leilabl","html_url":"https://github.com/leilabl","followers_url":"https://api.github.com/users/leilabl/followers","following_url":"https://api.github.com/users/leilabl/following{/other_user}","gists_url":"https://api.github.com/users/leilabl/gists{/gist_id}","starred_url":"https://api.github.com/users/leilabl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leilabl/subscriptions","organizations_url":"https://api.github.com/users/leilabl/orgs","repos_url":"https://api.github.com/users/leilabl/repos","events_url":"https://api.github.com/users/leilabl/events{/privacy}","received_events_url":"https://api.github.com/users/leilabl/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/leilabl/stackstore","description":"Grace Hopper project for a wine shop","fork":false,"url":"https://api.github.com/repos/leilabl/stackstore","forks_url":"https://api.github.com/repos/leilabl/stackstore/forks","keys_url":"https://api.github.com/repos/leilabl/stackstore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leilabl/stackstore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leilabl/stackstore/teams","hooks_url":"https://api.github.com/repos/leilabl/stackstore/hooks","issue_events_url":"https://api.github.com/repos/leilabl/stackstore/issues/events{/number}","events_url":"https://api.github.com/repos/leilabl/stackstore/events","assignees_url":"https://api.github.com/repos/leilabl/stackstore/assignees{/user}","branches_url":"https://api.github.com/repos/leilabl/stackstore/branches{/branch}","tags_url":"https://api.github.com/repos/leilabl/stackstore/tags","blobs_url":"https://api.github.com/repos/leilabl/stackstore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leilabl/stackstore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leilabl/stackstore/git/refs{/sha}","trees_url":"https://api.github.com/repos/leilabl/stackstore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leilabl/stackstore/statuses/{sha}","languages_url":"https://api.github.com/repos/leilabl/stackstore/languages","stargazers_url":"https://api.github.com/repos/leilabl/stackstore/stargazers","contributors_url":"https://api.github.com/repos/leilabl/stackstore/contributors","subscribers_url":"https://api.github.com/repos/leilabl/stackstore/subscribers","subscription_url":"https://api.github.com/repos/leilabl/stackstore/subscription","commits_url":"https://api.github.com/repos/leilabl/stackstore/commits{/sha}","git_commits_url":"https://api.github.com/repos/leilabl/stackstore/git/commits{/sha}","comments_url":"https://api.github.com/repos/leilabl/stackstore/comments{/number}","issue_comment_url":"https://api.github.com/repos/leilabl/stackstore/issues/comments{/number}","contents_url":"https://api.github.com/repos/leilabl/stackstore/contents/{+path}","compare_url":"https://api.github.com/repos/leilabl/stackstore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leilabl/stackstore/merges","archive_url":"https://api.github.com/repos/leilabl/stackstore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leilabl/stackstore/downloads","issues_url":"https://api.github.com/repos/leilabl/stackstore/issues{/number}","pulls_url":"https://api.github.com/repos/leilabl/stackstore/pulls{/number}","milestones_url":"https://api.github.com/repos/leilabl/stackstore/milestones{/number}","notifications_url":"https://api.github.com/repos/leilabl/stackstore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leilabl/stackstore/labels{/name}","releases_url":"https://api.github.com/repos/leilabl/stackstore/releases{/id}","deployments_url":"https://api.github.com/repos/leilabl/stackstore/deployments","created_at":"2016-02-29T17:53:57Z","updated_at":"2016-02-29T21:08:58Z","pushed_at":"2016-03-03T16:50:26Z","git_url":"git://github.com/leilabl/stackstore.git","ssh_url":"git@github.com:leilabl/stackstore.git","clone_url":"https://github.com/leilabl/stackstore.git","svn_url":"https://github.com/leilabl/stackstore","homepage":null,"size":925,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":19,"forks":0,"open_issues":19,"watchers":0,"default_branch":"master"}},"base":{"label":"leilabl:master","ref":"master","sha":"fd76a03c1e0e9bceee91d999aaffd789c74a758c","user":{"login":"leilabl","id":11221406,"avatar_url":"https://avatars.githubusercontent.com/u/11221406?v=3","gravatar_id":"","url":"https://api.github.com/users/leilabl","html_url":"https://github.com/leilabl","followers_url":"https://api.github.com/users/leilabl/followers","following_url":"https://api.github.com/users/leilabl/following{/other_user}","gists_url":"https://api.github.com/users/leilabl/gists{/gist_id}","starred_url":"https://api.github.com/users/leilabl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leilabl/subscriptions","organizations_url":"https://api.github.com/users/leilabl/orgs","repos_url":"https://api.github.com/users/leilabl/repos","events_url":"https://api.github.com/users/leilabl/events{/privacy}","received_events_url":"https://api.github.com/users/leilabl/received_events","type":"User","site_admin":false},"repo":{"id":52811375,"name":"stackstore","full_name":"leilabl/stackstore","owner":{"login":"leilabl","id":11221406,"avatar_url":"https://avatars.githubusercontent.com/u/11221406?v=3","gravatar_id":"","url":"https://api.github.com/users/leilabl","html_url":"https://github.com/leilabl","followers_url":"https://api.github.com/users/leilabl/followers","following_url":"https://api.github.com/users/leilabl/following{/other_user}","gists_url":"https://api.github.com/users/leilabl/gists{/gist_id}","starred_url":"https://api.github.com/users/leilabl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leilabl/subscriptions","organizations_url":"https://api.github.com/users/leilabl/orgs","repos_url":"https://api.github.com/users/leilabl/repos","events_url":"https://api.github.com/users/leilabl/events{/privacy}","received_events_url":"https://api.github.com/users/leilabl/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/leilabl/stackstore","description":"Grace Hopper project for a wine shop","fork":false,"url":"https://api.github.com/repos/leilabl/stackstore","forks_url":"https://api.github.com/repos/leilabl/stackstore/forks","keys_url":"https://api.github.com/repos/leilabl/stackstore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leilabl/stackstore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leilabl/stackstore/teams","hooks_url":"https://api.github.com/repos/leilabl/stackstore/hooks","issue_events_url":"https://api.github.com/repos/leilabl/stackstore/issues/events{/number}","events_url":"https://api.github.com/repos/leilabl/stackstore/events","assignees_url":"https://api.github.com/repos/leilabl/stackstore/assignees{/user}","branches_url":"https://api.github.com/repos/leilabl/stackstore/branches{/branch}","tags_url":"https://api.github.com/repos/leilabl/stackstore/tags","blobs_url":"https://api.github.com/repos/leilabl/stackstore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leilabl/stackstore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leilabl/stackstore/git/refs{/sha}","trees_url":"https://api.github.com/repos/leilabl/stackstore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leilabl/stackstore/statuses/{sha}","languages_url":"https://api.github.com/repos/leilabl/stackstore/languages","stargazers_url":"https://api.github.com/repos/leilabl/stackstore/stargazers","contributors_url":"https://api.github.com/repos/leilabl/stackstore/contributors","subscribers_url":"https://api.github.com/repos/leilabl/stackstore/subscribers","subscription_url":"https://api.github.com/repos/leilabl/stackstore/subscription","commits_url":"https://api.github.com/repos/leilabl/stackstore/commits{/sha}","git_commits_url":"https://api.github.com/repos/leilabl/stackstore/git/commits{/sha}","comments_url":"https://api.github.com/repos/leilabl/stackstore/comments{/number}","issue_comment_url":"https://api.github.com/repos/leilabl/stackstore/issues/comments{/number}","contents_url":"https://api.github.com/repos/leilabl/stackstore/contents/{+path}","compare_url":"https://api.github.com/repos/leilabl/stackstore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leilabl/stackstore/merges","archive_url":"https://api.github.com/repos/leilabl/stackstore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leilabl/stackstore/downloads","issues_url":"https://api.github.com/repos/leilabl/stackstore/issues{/number}","pulls_url":"https://api.github.com/repos/leilabl/stackstore/pulls{/number}","milestones_url":"https://api.github.com/repos/leilabl/stackstore/milestones{/number}","notifications_url":"https://api.github.com/repos/leilabl/stackstore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leilabl/stackstore/labels{/name}","releases_url":"https://api.github.com/repos/leilabl/stackstore/releases{/id}","deployments_url":"https://api.github.com/repos/leilabl/stackstore/deployments","created_at":"2016-02-29T17:53:57Z","updated_at":"2016-02-29T21:08:58Z","pushed_at":"2016-03-03T16:50:26Z","git_url":"git://github.com/leilabl/stackstore.git","ssh_url":"git@github.com:leilabl/stackstore.git","clone_url":"https://github.com/leilabl/stackstore.git","svn_url":"https://github.com/leilabl/stackstore","homepage":null,"size":925,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":19,"forks":0,"open_issues":19,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/leilabl/stackstore/pulls/44"},"html":{"href":"https://github.com/leilabl/stackstore/pull/44"},"issue":{"href":"https://api.github.com/repos/leilabl/stackstore/issues/44"},"comments":{"href":"https://api.github.com/repos/leilabl/stackstore/issues/44/comments"},"review_comments":{"href":"https://api.github.com/repos/leilabl/stackstore/pulls/44/comments"},"review_comment":{"href":"https://api.github.com/repos/leilabl/stackstore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/leilabl/stackstore/pulls/44/commits"},"statuses":{"href":"https://api.github.com/repos/leilabl/stackstore/statuses/ffd99c265e1368cd77c552aa024dad491ca7878b"}}}}