{"action":"created","comment":{"url":"https://api.github.com/repos/travel-and-help/start-kit/pulls/comments/68053796","id":68053796,"diff_hunk":"@@ -4,6 +4,14 @@ const categoryModel = require('./../../models/category');\n const userModel = require('./../../models/user');\n \n const getAll = (req, res, next) => {\n+    categoryModel.find({}, (err, categories) => {\n+        if (err) next(next);\n+\n+        res.json(categories);\n+    });\n+};\n+\n+const getUserSavedCategories = (req, res, next) => {\n     categoryModel.find({}, (err, foundCategories) => {\n         if (err) next(err);","path":"src/back/controllers/api/routes/categories/categories.js","position":13,"original_position":13,"commit_id":"5d0d7b14684998b87e748a9bbd51b62075d23169","original_commit_id":"5d0d7b14684998b87e748a9bbd51b62075d23169","user":{"login":"borys-ihnatyev","id":4295036,"avatar_url":"https://avatars.githubusercontent.com/u/4295036?v=3","gravatar_id":"","url":"https://api.github.com/users/borys-ihnatyev","html_url":"https://github.com/borys-ihnatyev","followers_url":"https://api.github.com/users/borys-ihnatyev/followers","following_url":"https://api.github.com/users/borys-ihnatyev/following{/other_user}","gists_url":"https://api.github.com/users/borys-ihnatyev/gists{/gist_id}","starred_url":"https://api.github.com/users/borys-ihnatyev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/borys-ihnatyev/subscriptions","organizations_url":"https://api.github.com/users/borys-ihnatyev/orgs","repos_url":"https://api.github.com/users/borys-ihnatyev/repos","events_url":"https://api.github.com/users/borys-ihnatyev/events{/privacy}","received_events_url":"https://api.github.com/users/borys-ihnatyev/received_events","type":"User","site_admin":false},"body":"you should add else statement or eturn, to avoid runing any code after next function call\r\notherwise this will cause error: attempt to send response twice\r\nGenerously, I would prefer to use promise instead.","created_at":"2016-06-22T13:38:31Z","updated_at":"2016-06-22T13:38:31Z","html_url":"https://github.com/travel-and-help/start-kit/pull/93#discussion_r68053796","pull_request_url":"https://api.github.com/repos/travel-and-help/start-kit/pulls/93","_links":{"self":{"href":"https://api.github.com/repos/travel-and-help/start-kit/pulls/comments/68053796"},"html":{"href":"https://github.com/travel-and-help/start-kit/pull/93#discussion_r68053796"},"pull_request":{"href":"https://api.github.com/repos/travel-and-help/start-kit/pulls/93"}}},"pull_request":{"url":"https://api.github.com/repos/travel-and-help/start-kit/pulls/93","id":74781861,"html_url":"https://github.com/travel-and-help/start-kit/pull/93","diff_url":"https://github.com/travel-and-help/start-kit/pull/93.diff","patch_url":"https://github.com/travel-and-help/start-kit/pull/93.patch","issue_url":"https://api.github.com/repos/travel-and-help/start-kit/issues/93","number":93,"state":"open","locked":false,"title":"#17 Selection of challenge topic upon login. Fix for getting all cate…","user":{"login":"Slash-hl","id":1446002,"avatar_url":"https://avatars.githubusercontent.com/u/1446002?v=3","gravatar_id":"","url":"https://api.github.com/users/Slash-hl","html_url":"https://github.com/Slash-hl","followers_url":"https://api.github.com/users/Slash-hl/followers","following_url":"https://api.github.com/users/Slash-hl/following{/other_user}","gists_url":"https://api.github.com/users/Slash-hl/gists{/gist_id}","starred_url":"https://api.github.com/users/Slash-hl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Slash-hl/subscriptions","organizations_url":"https://api.github.com/users/Slash-hl/orgs","repos_url":"https://api.github.com/users/Slash-hl/repos","events_url":"https://api.github.com/users/Slash-hl/events{/privacy}","received_events_url":"https://api.github.com/users/Slash-hl/received_events","type":"User","site_admin":false},"body":"Fix for getting all categories. ","created_at":"2016-06-22T13:16:44Z","updated_at":"2016-06-22T13:38:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"deb9259c30c395f325ced09e119b1bfc89a2d69b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/travel-and-help/start-kit/pulls/93/commits","review_comments_url":"https://api.github.com/repos/travel-and-help/start-kit/pulls/93/comments","review_comment_url":"https://api.github.com/repos/travel-and-help/start-kit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/travel-and-help/start-kit/issues/93/comments","statuses_url":"https://api.github.com/repos/travel-and-help/start-kit/statuses/5d0d7b14684998b87e748a9bbd51b62075d23169","head":{"label":"travel-and-help:fixGetAllCategories","ref":"fixGetAllCategories","sha":"5d0d7b14684998b87e748a9bbd51b62075d23169","user":{"login":"travel-and-help","id":17927662,"avatar_url":"https://avatars.githubusercontent.com/u/17927662?v=3","gravatar_id":"","url":"https://api.github.com/users/travel-and-help","html_url":"https://github.com/travel-and-help","followers_url":"https://api.github.com/users/travel-and-help/followers","following_url":"https://api.github.com/users/travel-and-help/following{/other_user}","gists_url":"https://api.github.com/users/travel-and-help/gists{/gist_id}","starred_url":"https://api.github.com/users/travel-and-help/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travel-and-help/subscriptions","organizations_url":"https://api.github.com/users/travel-and-help/orgs","repos_url":"https://api.github.com/users/travel-and-help/repos","events_url":"https://api.github.com/users/travel-and-help/events{/privacy}","received_events_url":"https://api.github.com/users/travel-and-help/received_events","type":"Organization","site_admin":false},"repo":{"id":54231926,"name":"start-kit","full_name":"travel-and-help/start-kit","owner":{"login":"travel-and-help","id":17927662,"avatar_url":"https://avatars.githubusercontent.com/u/17927662?v=3","gravatar_id":"","url":"https://api.github.com/users/travel-and-help","html_url":"https://github.com/travel-and-help","followers_url":"https://api.github.com/users/travel-and-help/followers","following_url":"https://api.github.com/users/travel-and-help/following{/other_user}","gists_url":"https://api.github.com/users/travel-and-help/gists{/gist_id}","starred_url":"https://api.github.com/users/travel-and-help/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travel-and-help/subscriptions","organizations_url":"https://api.github.com/users/travel-and-help/orgs","repos_url":"https://api.github.com/users/travel-and-help/repos","events_url":"https://api.github.com/users/travel-and-help/events{/privacy}","received_events_url":"https://api.github.com/users/travel-and-help/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/travel-and-help/start-kit","description":"","fork":false,"url":"https://api.github.com/repos/travel-and-help/start-kit","forks_url":"https://api.github.com/repos/travel-and-help/start-kit/forks","keys_url":"https://api.github.com/repos/travel-and-help/start-kit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/travel-and-help/start-kit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/travel-and-help/start-kit/teams","hooks_url":"https://api.github.com/repos/travel-and-help/start-kit/hooks","issue_events_url":"https://api.github.com/repos/travel-and-help/start-kit/issues/events{/number}","events_url":"https://api.github.com/repos/travel-and-help/start-kit/events","assignees_url":"https://api.github.com/repos/travel-and-help/start-kit/assignees{/user}","branches_url":"https://api.github.com/repos/travel-and-help/start-kit/branches{/branch}","tags_url":"https://api.github.com/repos/travel-and-help/start-kit/tags","blobs_url":"https://api.github.com/repos/travel-and-help/start-kit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/travel-and-help/start-kit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/travel-and-help/start-kit/git/refs{/sha}","trees_url":"https://api.github.com/repos/travel-and-help/start-kit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/travel-and-help/start-kit/statuses/{sha}","languages_url":"https://api.github.com/repos/travel-and-help/start-kit/languages","stargazers_url":"https://api.github.com/repos/travel-and-help/start-kit/stargazers","contributors_url":"https://api.github.com/repos/travel-and-help/start-kit/contributors","subscribers_url":"https://api.github.com/repos/travel-and-help/start-kit/subscribers","subscription_url":"https://api.github.com/repos/travel-and-help/start-kit/subscription","commits_url":"https://api.github.com/repos/travel-and-help/start-kit/commits{/sha}","git_commits_url":"https://api.github.com/repos/travel-and-help/start-kit/git/commits{/sha}","comments_url":"https://api.github.com/repos/travel-and-help/start-kit/comments{/number}","issue_comment_url":"https://api.github.com/repos/travel-and-help/start-kit/issues/comments{/number}","contents_url":"https://api.github.com/repos/travel-and-help/start-kit/contents/{+path}","compare_url":"https://api.github.com/repos/travel-and-help/start-kit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/travel-and-help/start-kit/merges","archive_url":"https://api.github.com/repos/travel-and-help/start-kit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/travel-and-help/start-kit/downloads","issues_url":"https://api.github.com/repos/travel-and-help/start-kit/issues{/number}","pulls_url":"https://api.github.com/repos/travel-and-help/start-kit/pulls{/number}","milestones_url":"https://api.github.com/repos/travel-and-help/start-kit/milestones{/number}","notifications_url":"https://api.github.com/repos/travel-and-help/start-kit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/travel-and-help/start-kit/labels{/name}","releases_url":"https://api.github.com/repos/travel-and-help/start-kit/releases{/id}","deployments_url":"https://api.github.com/repos/travel-and-help/start-kit/deployments","created_at":"2016-03-18T21:15:29Z","updated_at":"2016-06-09T07:59:01Z","pushed_at":"2016-06-22T13:16:44Z","git_url":"git://github.com/travel-and-help/start-kit.git","ssh_url":"git@github.com:travel-and-help/start-kit.git","clone_url":"https://github.com/travel-and-help/start-kit.git","svn_url":"https://github.com/travel-and-help/start-kit","homepage":"https://start-kit.herokuapp.com","size":1062,"stargazers_count":7,"watchers_count":7,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":4,"forks":1,"open_issues":4,"watchers":7,"default_branch":"master"}},"base":{"label":"travel-and-help:master","ref":"master","sha":"284e0471c2ead86b5fedbde4e3e9a8d4d60bcfb6","user":{"login":"travel-and-help","id":17927662,"avatar_url":"https://avatars.githubusercontent.com/u/17927662?v=3","gravatar_id":"","url":"https://api.github.com/users/travel-and-help","html_url":"https://github.com/travel-and-help","followers_url":"https://api.github.com/users/travel-and-help/followers","following_url":"https://api.github.com/users/travel-and-help/following{/other_user}","gists_url":"https://api.github.com/users/travel-and-help/gists{/gist_id}","starred_url":"https://api.github.com/users/travel-and-help/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travel-and-help/subscriptions","organizations_url":"https://api.github.com/users/travel-and-help/orgs","repos_url":"https://api.github.com/users/travel-and-help/repos","events_url":"https://api.github.com/users/travel-and-help/events{/privacy}","received_events_url":"https://api.github.com/users/travel-and-help/received_events","type":"Organization","site_admin":false},"repo":{"id":54231926,"name":"start-kit","full_name":"travel-and-help/start-kit","owner":{"login":"travel-and-help","id":17927662,"avatar_url":"https://avatars.githubusercontent.com/u/17927662?v=3","gravatar_id":"","url":"https://api.github.com/users/travel-and-help","html_url":"https://github.com/travel-and-help","followers_url":"https://api.github.com/users/travel-and-help/followers","following_url":"https://api.github.com/users/travel-and-help/following{/other_user}","gists_url":"https://api.github.com/users/travel-and-help/gists{/gist_id}","starred_url":"https://api.github.com/users/travel-and-help/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travel-and-help/subscriptions","organizations_url":"https://api.github.com/users/travel-and-help/orgs","repos_url":"https://api.github.com/users/travel-and-help/repos","events_url":"https://api.github.com/users/travel-and-help/events{/privacy}","received_events_url":"https://api.github.com/users/travel-and-help/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/travel-and-help/start-kit","description":"","fork":false,"url":"https://api.github.com/repos/travel-and-help/start-kit","forks_url":"https://api.github.com/repos/travel-and-help/start-kit/forks","keys_url":"https://api.github.com/repos/travel-and-help/start-kit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/travel-and-help/start-kit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/travel-and-help/start-kit/teams","hooks_url":"https://api.github.com/repos/travel-and-help/start-kit/hooks","issue_events_url":"https://api.github.com/repos/travel-and-help/start-kit/issues/events{/number}","events_url":"https://api.github.com/repos/travel-and-help/start-kit/events","assignees_url":"https://api.github.com/repos/travel-and-help/start-kit/assignees{/user}","branches_url":"https://api.github.com/repos/travel-and-help/start-kit/branches{/branch}","tags_url":"https://api.github.com/repos/travel-and-help/start-kit/tags","blobs_url":"https://api.github.com/repos/travel-and-help/start-kit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/travel-and-help/start-kit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/travel-and-help/start-kit/git/refs{/sha}","trees_url":"https://api.github.com/repos/travel-and-help/start-kit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/travel-and-help/start-kit/statuses/{sha}","languages_url":"https://api.github.com/repos/travel-and-help/start-kit/languages","stargazers_url":"https://api.github.com/repos/travel-and-help/start-kit/stargazers","contributors_url":"https://api.github.com/repos/travel-and-help/start-kit/contributors","subscribers_url":"https://api.github.com/repos/travel-and-help/start-kit/subscribers","subscription_url":"https://api.github.com/repos/travel-and-help/start-kit/subscription","commits_url":"https://api.github.com/repos/travel-and-help/start-kit/commits{/sha}","git_commits_url":"https://api.github.com/repos/travel-and-help/start-kit/git/commits{/sha}","comments_url":"https://api.github.com/repos/travel-and-help/start-kit/comments{/number}","issue_comment_url":"https://api.github.com/repos/travel-and-help/start-kit/issues/comments{/number}","contents_url":"https://api.github.com/repos/travel-and-help/start-kit/contents/{+path}","compare_url":"https://api.github.com/repos/travel-and-help/start-kit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/travel-and-help/start-kit/merges","archive_url":"https://api.github.com/repos/travel-and-help/start-kit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/travel-and-help/start-kit/downloads","issues_url":"https://api.github.com/repos/travel-and-help/start-kit/issues{/number}","pulls_url":"https://api.github.com/repos/travel-and-help/start-kit/pulls{/number}","milestones_url":"https://api.github.com/repos/travel-and-help/start-kit/milestones{/number}","notifications_url":"https://api.github.com/repos/travel-and-help/start-kit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/travel-and-help/start-kit/labels{/name}","releases_url":"https://api.github.com/repos/travel-and-help/start-kit/releases{/id}","deployments_url":"https://api.github.com/repos/travel-and-help/start-kit/deployments","created_at":"2016-03-18T21:15:29Z","updated_at":"2016-06-09T07:59:01Z","pushed_at":"2016-06-22T13:16:44Z","git_url":"git://github.com/travel-and-help/start-kit.git","ssh_url":"git@github.com:travel-and-help/start-kit.git","clone_url":"https://github.com/travel-and-help/start-kit.git","svn_url":"https://github.com/travel-and-help/start-kit","homepage":"https://start-kit.herokuapp.com","size":1062,"stargazers_count":7,"watchers_count":7,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":4,"forks":1,"open_issues":4,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/travel-and-help/start-kit/pulls/93"},"html":{"href":"https://github.com/travel-and-help/start-kit/pull/93"},"issue":{"href":"https://api.github.com/repos/travel-and-help/start-kit/issues/93"},"comments":{"href":"https://api.github.com/repos/travel-and-help/start-kit/issues/93/comments"},"review_comments":{"href":"https://api.github.com/repos/travel-and-help/start-kit/pulls/93/comments"},"review_comment":{"href":"https://api.github.com/repos/travel-and-help/start-kit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/travel-and-help/start-kit/pulls/93/commits"},"statuses":{"href":"https://api.github.com/repos/travel-and-help/start-kit/statuses/5d0d7b14684998b87e748a9bbd51b62075d23169"}}}}
{"actor":{"display_login":"borys-ihnatyev"}}