{"action":"created","comment":{"url":"https://api.github.com/repos/branquinhoaa/poll-app/pulls/comments/72890155","id":72890155,"diff_hunk":"@@ -0,0 +1,81 @@\n+var flash = require('../utilities/flash.js').flash;\n+var Model = require('../models/models.js');\n+\n+module.exports = {\n+ \n+ deletePoll: function(req, res){\n+  var id= req.query.id;\n+  Model.PollsModel.remove({_id:id}, function(err, result){\n+   if (err) {\n+    flash(req, 'danger', 'poll was not deleted', 'try again');\n+    console.log (\"I could not delete the poll!\")}\n+   else{\n+    flash(req, 'success', 'poll deleted', 'your poll was deleted');\n+    res.redirect(302,'/polls/myPolls'); ","path":"controllers/PollController.js","position":14,"original_position":14,"commit_id":"4bf0a6708b7e434ae9a1027281eba56fb9dc2464","original_commit_id":"4bf0a6708b7e434ae9a1027281eba56fb9dc2464","user":{"login":"halissonvit","id":379034,"avatar_url":"https://avatars.githubusercontent.com/u/379034?v=3","gravatar_id":"","url":"https://api.github.com/users/halissonvit","html_url":"https://github.com/halissonvit","followers_url":"https://api.github.com/users/halissonvit/followers","following_url":"https://api.github.com/users/halissonvit/following{/other_user}","gists_url":"https://api.github.com/users/halissonvit/gists{/gist_id}","starred_url":"https://api.github.com/users/halissonvit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/halissonvit/subscriptions","organizations_url":"https://api.github.com/users/halissonvit/orgs","repos_url":"https://api.github.com/users/halissonvit/repos","events_url":"https://api.github.com/users/halissonvit/events{/privacy}","received_events_url":"https://api.github.com/users/halissonvit/received_events","type":"User","site_admin":false},"body":"you don't need to specify the http status for every redirect... you can use just redirect(path)","created_at":"2016-07-30T16:24:03Z","updated_at":"2016-07-30T16:24:03Z","html_url":"https://github.com/branquinhoaa/poll-app/pull/1#discussion_r72890155","pull_request_url":"https://api.github.com/repos/branquinhoaa/poll-app/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/branquinhoaa/poll-app/pulls/comments/72890155"},"html":{"href":"https://github.com/branquinhoaa/poll-app/pull/1#discussion_r72890155"},"pull_request":{"href":"https://api.github.com/repos/branquinhoaa/poll-app/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/branquinhoaa/poll-app/pulls/1","id":78699435,"html_url":"https://github.com/branquinhoaa/poll-app/pull/1","diff_url":"https://github.com/branquinhoaa/poll-app/pull/1.diff","patch_url":"https://github.com/branquinhoaa/poll-app/pull/1.patch","issue_url":"https://api.github.com/repos/branquinhoaa/poll-app/issues/1","number":1,"state":"open","locked":false,"title":"App","user":{"login":"branquinhoaa","id":15239141,"avatar_url":"https://avatars.githubusercontent.com/u/15239141?v=3","gravatar_id":"","url":"https://api.github.com/users/branquinhoaa","html_url":"https://github.com/branquinhoaa","followers_url":"https://api.github.com/users/branquinhoaa/followers","following_url":"https://api.github.com/users/branquinhoaa/following{/other_user}","gists_url":"https://api.github.com/users/branquinhoaa/gists{/gist_id}","starred_url":"https://api.github.com/users/branquinhoaa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/branquinhoaa/subscriptions","organizations_url":"https://api.github.com/users/branquinhoaa/orgs","repos_url":"https://api.github.com/users/branquinhoaa/repos","events_url":"https://api.github.com/users/branquinhoaa/events{/privacy}","received_events_url":"https://api.github.com/users/branquinhoaa/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-25T15:15:43Z","updated_at":"2016-07-30T16:24:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2cf074d47604fa44fc844eef684d572e38bfb344","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/branquinhoaa/poll-app/pulls/1/commits","review_comments_url":"https://api.github.com/repos/branquinhoaa/poll-app/pulls/1/comments","review_comment_url":"https://api.github.com/repos/branquinhoaa/poll-app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/branquinhoaa/poll-app/issues/1/comments","statuses_url":"https://api.github.com/repos/branquinhoaa/poll-app/statuses/4bf0a6708b7e434ae9a1027281eba56fb9dc2464","head":{"label":"branquinhoaa:app","ref":"app","sha":"4bf0a6708b7e434ae9a1027281eba56fb9dc2464","user":{"login":"branquinhoaa","id":15239141,"avatar_url":"https://avatars.githubusercontent.com/u/15239141?v=3","gravatar_id":"","url":"https://api.github.com/users/branquinhoaa","html_url":"https://github.com/branquinhoaa","followers_url":"https://api.github.com/users/branquinhoaa/followers","following_url":"https://api.github.com/users/branquinhoaa/following{/other_user}","gists_url":"https://api.github.com/users/branquinhoaa/gists{/gist_id}","starred_url":"https://api.github.com/users/branquinhoaa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/branquinhoaa/subscriptions","organizations_url":"https://api.github.com/users/branquinhoaa/orgs","repos_url":"https://api.github.com/users/branquinhoaa/repos","events_url":"https://api.github.com/users/branquinhoaa/events{/privacy}","received_events_url":"https://api.github.com/users/branquinhoaa/received_events","type":"User","site_admin":false},"repo":{"id":64141627,"name":"poll-app","full_name":"branquinhoaa/poll-app","owner":{"login":"branquinhoaa","id":15239141,"avatar_url":"https://avatars.githubusercontent.com/u/15239141?v=3","gravatar_id":"","url":"https://api.github.com/users/branquinhoaa","html_url":"https://github.com/branquinhoaa","followers_url":"https://api.github.com/users/branquinhoaa/followers","following_url":"https://api.github.com/users/branquinhoaa/following{/other_user}","gists_url":"https://api.github.com/users/branquinhoaa/gists{/gist_id}","starred_url":"https://api.github.com/users/branquinhoaa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/branquinhoaa/subscriptions","organizations_url":"https://api.github.com/users/branquinhoaa/orgs","repos_url":"https://api.github.com/users/branquinhoaa/repos","events_url":"https://api.github.com/users/branquinhoaa/events{/privacy}","received_events_url":"https://api.github.com/users/branquinhoaa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/branquinhoaa/poll-app","description":null,"fork":false,"url":"https://api.github.com/repos/branquinhoaa/poll-app","forks_url":"https://api.github.com/repos/branquinhoaa/poll-app/forks","keys_url":"https://api.github.com/repos/branquinhoaa/poll-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/branquinhoaa/poll-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/branquinhoaa/poll-app/teams","hooks_url":"https://api.github.com/repos/branquinhoaa/poll-app/hooks","issue_events_url":"https://api.github.com/repos/branquinhoaa/poll-app/issues/events{/number}","events_url":"https://api.github.com/repos/branquinhoaa/poll-app/events","assignees_url":"https://api.github.com/repos/branquinhoaa/poll-app/assignees{/user}","branches_url":"https://api.github.com/repos/branquinhoaa/poll-app/branches{/branch}","tags_url":"https://api.github.com/repos/branquinhoaa/poll-app/tags","blobs_url":"https://api.github.com/repos/branquinhoaa/poll-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/branquinhoaa/poll-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/branquinhoaa/poll-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/branquinhoaa/poll-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/branquinhoaa/poll-app/statuses/{sha}","languages_url":"https://api.github.com/repos/branquinhoaa/poll-app/languages","stargazers_url":"https://api.github.com/repos/branquinhoaa/poll-app/stargazers","contributors_url":"https://api.github.com/repos/branquinhoaa/poll-app/contributors","subscribers_url":"https://api.github.com/repos/branquinhoaa/poll-app/subscribers","subscription_url":"https://api.github.com/repos/branquinhoaa/poll-app/subscription","commits_url":"https://api.github.com/repos/branquinhoaa/poll-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/branquinhoaa/poll-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/branquinhoaa/poll-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/branquinhoaa/poll-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/branquinhoaa/poll-app/contents/{+path}","compare_url":"https://api.github.com/repos/branquinhoaa/poll-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/branquinhoaa/poll-app/merges","archive_url":"https://api.github.com/repos/branquinhoaa/poll-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/branquinhoaa/poll-app/downloads","issues_url":"https://api.github.com/repos/branquinhoaa/poll-app/issues{/number}","pulls_url":"https://api.github.com/repos/branquinhoaa/poll-app/pulls{/number}","milestones_url":"https://api.github.com/repos/branquinhoaa/poll-app/milestones{/number}","notifications_url":"https://api.github.com/repos/branquinhoaa/poll-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/branquinhoaa/poll-app/labels{/name}","releases_url":"https://api.github.com/repos/branquinhoaa/poll-app/releases{/id}","deployments_url":"https://api.github.com/repos/branquinhoaa/poll-app/deployments","created_at":"2016-07-25T14:32:10Z","updated_at":"2016-07-25T14:32:10Z","pushed_at":"2016-07-29T01:11:06Z","git_url":"git://github.com/branquinhoaa/poll-app.git","ssh_url":"git@github.com:branquinhoaa/poll-app.git","clone_url":"https://github.com/branquinhoaa/poll-app.git","svn_url":"https://github.com/branquinhoaa/poll-app","homepage":null,"size":62,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":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":"branquinhoaa:master","ref":"master","sha":"91af1964a3addb120b53ea4d54f25e92ae4cbb8f","user":{"login":"branquinhoaa","id":15239141,"avatar_url":"https://avatars.githubusercontent.com/u/15239141?v=3","gravatar_id":"","url":"https://api.github.com/users/branquinhoaa","html_url":"https://github.com/branquinhoaa","followers_url":"https://api.github.com/users/branquinhoaa/followers","following_url":"https://api.github.com/users/branquinhoaa/following{/other_user}","gists_url":"https://api.github.com/users/branquinhoaa/gists{/gist_id}","starred_url":"https://api.github.com/users/branquinhoaa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/branquinhoaa/subscriptions","organizations_url":"https://api.github.com/users/branquinhoaa/orgs","repos_url":"https://api.github.com/users/branquinhoaa/repos","events_url":"https://api.github.com/users/branquinhoaa/events{/privacy}","received_events_url":"https://api.github.com/users/branquinhoaa/received_events","type":"User","site_admin":false},"repo":{"id":64141627,"name":"poll-app","full_name":"branquinhoaa/poll-app","owner":{"login":"branquinhoaa","id":15239141,"avatar_url":"https://avatars.githubusercontent.com/u/15239141?v=3","gravatar_id":"","url":"https://api.github.com/users/branquinhoaa","html_url":"https://github.com/branquinhoaa","followers_url":"https://api.github.com/users/branquinhoaa/followers","following_url":"https://api.github.com/users/branquinhoaa/following{/other_user}","gists_url":"https://api.github.com/users/branquinhoaa/gists{/gist_id}","starred_url":"https://api.github.com/users/branquinhoaa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/branquinhoaa/subscriptions","organizations_url":"https://api.github.com/users/branquinhoaa/orgs","repos_url":"https://api.github.com/users/branquinhoaa/repos","events_url":"https://api.github.com/users/branquinhoaa/events{/privacy}","received_events_url":"https://api.github.com/users/branquinhoaa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/branquinhoaa/poll-app","description":null,"fork":false,"url":"https://api.github.com/repos/branquinhoaa/poll-app","forks_url":"https://api.github.com/repos/branquinhoaa/poll-app/forks","keys_url":"https://api.github.com/repos/branquinhoaa/poll-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/branquinhoaa/poll-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/branquinhoaa/poll-app/teams","hooks_url":"https://api.github.com/repos/branquinhoaa/poll-app/hooks","issue_events_url":"https://api.github.com/repos/branquinhoaa/poll-app/issues/events{/number}","events_url":"https://api.github.com/repos/branquinhoaa/poll-app/events","assignees_url":"https://api.github.com/repos/branquinhoaa/poll-app/assignees{/user}","branches_url":"https://api.github.com/repos/branquinhoaa/poll-app/branches{/branch}","tags_url":"https://api.github.com/repos/branquinhoaa/poll-app/tags","blobs_url":"https://api.github.com/repos/branquinhoaa/poll-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/branquinhoaa/poll-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/branquinhoaa/poll-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/branquinhoaa/poll-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/branquinhoaa/poll-app/statuses/{sha}","languages_url":"https://api.github.com/repos/branquinhoaa/poll-app/languages","stargazers_url":"https://api.github.com/repos/branquinhoaa/poll-app/stargazers","contributors_url":"https://api.github.com/repos/branquinhoaa/poll-app/contributors","subscribers_url":"https://api.github.com/repos/branquinhoaa/poll-app/subscribers","subscription_url":"https://api.github.com/repos/branquinhoaa/poll-app/subscription","commits_url":"https://api.github.com/repos/branquinhoaa/poll-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/branquinhoaa/poll-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/branquinhoaa/poll-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/branquinhoaa/poll-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/branquinhoaa/poll-app/contents/{+path}","compare_url":"https://api.github.com/repos/branquinhoaa/poll-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/branquinhoaa/poll-app/merges","archive_url":"https://api.github.com/repos/branquinhoaa/poll-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/branquinhoaa/poll-app/downloads","issues_url":"https://api.github.com/repos/branquinhoaa/poll-app/issues{/number}","pulls_url":"https://api.github.com/repos/branquinhoaa/poll-app/pulls{/number}","milestones_url":"https://api.github.com/repos/branquinhoaa/poll-app/milestones{/number}","notifications_url":"https://api.github.com/repos/branquinhoaa/poll-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/branquinhoaa/poll-app/labels{/name}","releases_url":"https://api.github.com/repos/branquinhoaa/poll-app/releases{/id}","deployments_url":"https://api.github.com/repos/branquinhoaa/poll-app/deployments","created_at":"2016-07-25T14:32:10Z","updated_at":"2016-07-25T14:32:10Z","pushed_at":"2016-07-29T01:11:06Z","git_url":"git://github.com/branquinhoaa/poll-app.git","ssh_url":"git@github.com:branquinhoaa/poll-app.git","clone_url":"https://github.com/branquinhoaa/poll-app.git","svn_url":"https://github.com/branquinhoaa/poll-app","homepage":null,"size":62,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":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/branquinhoaa/poll-app/pulls/1"},"html":{"href":"https://github.com/branquinhoaa/poll-app/pull/1"},"issue":{"href":"https://api.github.com/repos/branquinhoaa/poll-app/issues/1"},"comments":{"href":"https://api.github.com/repos/branquinhoaa/poll-app/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/branquinhoaa/poll-app/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/branquinhoaa/poll-app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/branquinhoaa/poll-app/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/branquinhoaa/poll-app/statuses/4bf0a6708b7e434ae9a1027281eba56fb9dc2464"}}}}
{"actor":{"display_login":"halissonvit"}}