{"action":"created","comment":{"url":"https://api.github.com/repos/andela/thor-ah/pulls/comments/216678051","pull_request_review_id":154213824,"id":216678051,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNjY3ODA1MQ==","diff_hunk":"@@ -0,0 +1,35 @@\n+import { Router } from 'express';\n+import CategoryController from '../../controllers/categoryController';\n+import auth from '../../middleware/auth';\n+\n+const { authenticateUser, authorizeAuthor, authorizeAdmin } = auth;\n+const categoryRouter = Router();\n+\n+// Users can get all articles\n+categoryRouter.get('/', authenticateUser, CategoryController.getAllCategories);\n+\n+// Admin can create a new category\n+categoryRouter.post('/', authenticateUser, authorizeAdmin, CategoryController.createCategory);\n+\n+// Admin can update a category\n+categoryRouter.put('/:categoryName', authenticateUser, authorizeAdmin, CategoryController.updateCategory);\n+\n+// Admin can delete a category\n+categoryRouter.delete('/:categoryName', authenticateUser, authorizeAdmin, CategoryController.deleteCategory);\n+\n+// Authors can add their article(s) to a category\n+categoryRouter.post(\n+  '/:categoryName', authenticateUser, authorizeAuthor, CategoryController.addArticleToACategory\n+);\n+\n+// Users can get all articles for a category\n+categoryRouter.get(\n+  '/:categoryName/articles', authenticateUser, CategoryController.getAllArticlesForACategory\n+);\n+\n+// Authors can remove their article(s) from a category\n+categoryRouter.delete(\n+  '/:categoryName/articles', authenticateUser, authorizeAuthor, CategoryController.removeArticleFromACategory\n+);","path":"server/routes/api/categoryRoute.js","position":33,"original_position":33,"commit_id":"ab7eb13b0502394d146f70f314dcb15877ec9baa","original_commit_id":"ab7eb13b0502394d146f70f314dcb15877ec9baa","user":{"login":"houndci-bot","id":6697940,"node_id":"MDQ6VXNlcjY2OTc5NDA=","avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Unexpected newline before ')'  function-paren-newline","created_at":"2018-09-11T13:54:13Z","updated_at":"2018-09-11T13:54:14Z","html_url":"https://github.com/andela/thor-ah/pull/43#discussion_r216678051","pull_request_url":"https://api.github.com/repos/andela/thor-ah/pulls/43","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/andela/thor-ah/pulls/comments/216678051"},"html":{"href":"https://github.com/andela/thor-ah/pull/43#discussion_r216678051"},"pull_request":{"href":"https://api.github.com/repos/andela/thor-ah/pulls/43"}}},"pull_request":{"url":"https://api.github.com/repos/andela/thor-ah/pulls/43","id":214638772,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE0NjM4Nzcy","html_url":"https://github.com/andela/thor-ah/pull/43","diff_url":"https://github.com/andela/thor-ah/pull/43.diff","patch_url":"https://github.com/andela/thor-ah/pull/43.patch","issue_url":"https://api.github.com/repos/andela/thor-ah/issues/43","number":43,"state":"open","locked":false,"title":"#160314849 Users should be able to categorise their articles","user":{"login":"emmaadesile","id":26192691,"node_id":"MDQ6VXNlcjI2MTkyNjkx","avatar_url":"https://avatars2.githubusercontent.com/u/26192691?v=4","gravatar_id":"","url":"https://api.github.com/users/emmaadesile","html_url":"https://github.com/emmaadesile","followers_url":"https://api.github.com/users/emmaadesile/followers","following_url":"https://api.github.com/users/emmaadesile/following{/other_user}","gists_url":"https://api.github.com/users/emmaadesile/gists{/gist_id}","starred_url":"https://api.github.com/users/emmaadesile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emmaadesile/subscriptions","organizations_url":"https://api.github.com/users/emmaadesile/orgs","repos_url":"https://api.github.com/users/emmaadesile/repos","events_url":"https://api.github.com/users/emmaadesile/events{/privacy}","received_events_url":"https://api.github.com/users/emmaadesile/received_events","type":"User","site_admin":false},"body":"### What does this PR do?\r\nUsers can categorize their articles\r\n\r\n### Description of tasks to be completed\r\n- Admins can do CRUD operations on categories\r\n- Users can get all categories\r\n- Users can view all the articles in a category\r\n- Authors can add their articles to a category\r\n- Authors can remove their articles from any category\r\n\r\n### How to manually test it\r\n- After cloning the repo\r\n- Install and configure Postgresql\r\n- use .envsample to create your environment variables\r\n- run npm install to install dependencies\r\n- run npm run migrate to create the create tables in the db\r\n- run npm start:dev to start the development server\r\n- Admin can createPOST a new category/api/article-categories\r\n- Admin can updatePUT an existing category `/api/article-categories/:categoryName\r\n- Admin can delete DELETE an existing category /api/article-categories/:categoryName\r\n- Admin cannot add more than 10 categories\r\n- A user or an author to view all categories GET /api/article-categories\r\n- A user or an author can view all articles in a category GET /api/article-categories\r\n- Authors can add their article(s) to a category using the article title POST /api/article-categories/:categoryName\r\n\r\n### What are the relevant pivotal tracker stories?\r\n[160314849](https://www.pivotaltracker.com/story/show/160314849)","created_at":"2018-09-11T13:47:22Z","updated_at":"2018-09-11T13:54:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"961e9bcb0b47d270c86081374604fecba9873f21","assignee":null,"assignees":[],"requested_reviewers":[{"login":"aknwosu","id":24938070,"node_id":"MDQ6VXNlcjI0OTM4MDcw","avatar_url":"https://avatars3.githubusercontent.com/u/24938070?v=4","gravatar_id":"","url":"https://api.github.com/users/aknwosu","html_url":"https://github.com/aknwosu","followers_url":"https://api.github.com/users/aknwosu/followers","following_url":"https://api.github.com/users/aknwosu/following{/other_user}","gists_url":"https://api.github.com/users/aknwosu/gists{/gist_id}","starred_url":"https://api.github.com/users/aknwosu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aknwosu/subscriptions","organizations_url":"https://api.github.com/users/aknwosu/orgs","repos_url":"https://api.github.com/users/aknwosu/repos","events_url":"https://api.github.com/users/aknwosu/events{/privacy}","received_events_url":"https://api.github.com/users/aknwosu/received_events","type":"User","site_admin":false},{"login":"CEOehis","id":25967737,"node_id":"MDQ6VXNlcjI1OTY3NzM3","avatar_url":"https://avatars0.githubusercontent.com/u/25967737?v=4","gravatar_id":"","url":"https://api.github.com/users/CEOehis","html_url":"https://github.com/CEOehis","followers_url":"https://api.github.com/users/CEOehis/followers","following_url":"https://api.github.com/users/CEOehis/following{/other_user}","gists_url":"https://api.github.com/users/CEOehis/gists{/gist_id}","starred_url":"https://api.github.com/users/CEOehis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CEOehis/subscriptions","organizations_url":"https://api.github.com/users/CEOehis/orgs","repos_url":"https://api.github.com/users/CEOehis/repos","events_url":"https://api.github.com/users/CEOehis/events{/privacy}","received_events_url":"https://api.github.com/users/CEOehis/received_events","type":"User","site_admin":false},{"login":"d-beloved","id":26516851,"node_id":"MDQ6VXNlcjI2NTE2ODUx","avatar_url":"https://avatars0.githubusercontent.com/u/26516851?v=4","gravatar_id":"","url":"https://api.github.com/users/d-beloved","html_url":"https://github.com/d-beloved","followers_url":"https://api.github.com/users/d-beloved/followers","following_url":"https://api.github.com/users/d-beloved/following{/other_user}","gists_url":"https://api.github.com/users/d-beloved/gists{/gist_id}","starred_url":"https://api.github.com/users/d-beloved/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d-beloved/subscriptions","organizations_url":"https://api.github.com/users/d-beloved/orgs","repos_url":"https://api.github.com/users/d-beloved/repos","events_url":"https://api.github.com/users/d-beloved/events{/privacy}","received_events_url":"https://api.github.com/users/d-beloved/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/andela/thor-ah/pulls/43/commits","review_comments_url":"https://api.github.com/repos/andela/thor-ah/pulls/43/comments","review_comment_url":"https://api.github.com/repos/andela/thor-ah/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela/thor-ah/issues/43/comments","statuses_url":"https://api.github.com/repos/andela/thor-ah/statuses/ab7eb13b0502394d146f70f314dcb15877ec9baa","head":{"label":"andela:ft-categorize-articles-160314849","ref":"ft-categorize-articles-160314849","sha":"ab7eb13b0502394d146f70f314dcb15877ec9baa","user":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":145831905,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU4MzE5MDU=","name":"thor-ah","full_name":"andela/thor-ah","owner":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/thor-ah","description":"Staging Link for Author's Haven ","fork":false,"url":"https://api.github.com/repos/andela/thor-ah","forks_url":"https://api.github.com/repos/andela/thor-ah/forks","keys_url":"https://api.github.com/repos/andela/thor-ah/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/thor-ah/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/thor-ah/teams","hooks_url":"https://api.github.com/repos/andela/thor-ah/hooks","issue_events_url":"https://api.github.com/repos/andela/thor-ah/issues/events{/number}","events_url":"https://api.github.com/repos/andela/thor-ah/events","assignees_url":"https://api.github.com/repos/andela/thor-ah/assignees{/user}","branches_url":"https://api.github.com/repos/andela/thor-ah/branches{/branch}","tags_url":"https://api.github.com/repos/andela/thor-ah/tags","blobs_url":"https://api.github.com/repos/andela/thor-ah/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/thor-ah/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/thor-ah/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/thor-ah/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/thor-ah/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/thor-ah/languages","stargazers_url":"https://api.github.com/repos/andela/thor-ah/stargazers","contributors_url":"https://api.github.com/repos/andela/thor-ah/contributors","subscribers_url":"https://api.github.com/repos/andela/thor-ah/subscribers","subscription_url":"https://api.github.com/repos/andela/thor-ah/subscription","commits_url":"https://api.github.com/repos/andela/thor-ah/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/thor-ah/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/thor-ah/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/thor-ah/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/thor-ah/contents/{+path}","compare_url":"https://api.github.com/repos/andela/thor-ah/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/thor-ah/merges","archive_url":"https://api.github.com/repos/andela/thor-ah/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/thor-ah/downloads","issues_url":"https://api.github.com/repos/andela/thor-ah/issues{/number}","pulls_url":"https://api.github.com/repos/andela/thor-ah/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/thor-ah/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/thor-ah/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/thor-ah/labels{/name}","releases_url":"https://api.github.com/repos/andela/thor-ah/releases{/id}","deployments_url":"https://api.github.com/repos/andela/thor-ah/deployments","created_at":"2018-08-23T09:31:23Z","updated_at":"2018-09-11T10:55:33Z","pushed_at":"2018-09-11T13:53:56Z","git_url":"git://github.com/andela/thor-ah.git","ssh_url":"git@github.com:andela/thor-ah.git","clone_url":"https://github.com/andela/thor-ah.git","svn_url":"https://github.com/andela/thor-ah","homepage":"https://thor-ah-staging.herokuapp.com/","size":268,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":3,"license":null,"forks":1,"open_issues":3,"watchers":5,"default_branch":"develop"}},"base":{"label":"andela:develop","ref":"develop","sha":"207fdd8b1cfd96ac410950593df03311feac0e7d","user":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":145831905,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU4MzE5MDU=","name":"thor-ah","full_name":"andela/thor-ah","owner":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/thor-ah","description":"Staging Link for Author's Haven ","fork":false,"url":"https://api.github.com/repos/andela/thor-ah","forks_url":"https://api.github.com/repos/andela/thor-ah/forks","keys_url":"https://api.github.com/repos/andela/thor-ah/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/thor-ah/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/thor-ah/teams","hooks_url":"https://api.github.com/repos/andela/thor-ah/hooks","issue_events_url":"https://api.github.com/repos/andela/thor-ah/issues/events{/number}","events_url":"https://api.github.com/repos/andela/thor-ah/events","assignees_url":"https://api.github.com/repos/andela/thor-ah/assignees{/user}","branches_url":"https://api.github.com/repos/andela/thor-ah/branches{/branch}","tags_url":"https://api.github.com/repos/andela/thor-ah/tags","blobs_url":"https://api.github.com/repos/andela/thor-ah/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/thor-ah/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/thor-ah/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/thor-ah/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/thor-ah/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/thor-ah/languages","stargazers_url":"https://api.github.com/repos/andela/thor-ah/stargazers","contributors_url":"https://api.github.com/repos/andela/thor-ah/contributors","subscribers_url":"https://api.github.com/repos/andela/thor-ah/subscribers","subscription_url":"https://api.github.com/repos/andela/thor-ah/subscription","commits_url":"https://api.github.com/repos/andela/thor-ah/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/thor-ah/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/thor-ah/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/thor-ah/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/thor-ah/contents/{+path}","compare_url":"https://api.github.com/repos/andela/thor-ah/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/thor-ah/merges","archive_url":"https://api.github.com/repos/andela/thor-ah/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/thor-ah/downloads","issues_url":"https://api.github.com/repos/andela/thor-ah/issues{/number}","pulls_url":"https://api.github.com/repos/andela/thor-ah/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/thor-ah/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/thor-ah/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/thor-ah/labels{/name}","releases_url":"https://api.github.com/repos/andela/thor-ah/releases{/id}","deployments_url":"https://api.github.com/repos/andela/thor-ah/deployments","created_at":"2018-08-23T09:31:23Z","updated_at":"2018-09-11T10:55:33Z","pushed_at":"2018-09-11T13:53:56Z","git_url":"git://github.com/andela/thor-ah.git","ssh_url":"git@github.com:andela/thor-ah.git","clone_url":"https://github.com/andela/thor-ah.git","svn_url":"https://github.com/andela/thor-ah","homepage":"https://thor-ah-staging.herokuapp.com/","size":268,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":3,"license":null,"forks":1,"open_issues":3,"watchers":5,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/andela/thor-ah/pulls/43"},"html":{"href":"https://github.com/andela/thor-ah/pull/43"},"issue":{"href":"https://api.github.com/repos/andela/thor-ah/issues/43"},"comments":{"href":"https://api.github.com/repos/andela/thor-ah/issues/43/comments"},"review_comments":{"href":"https://api.github.com/repos/andela/thor-ah/pulls/43/comments"},"review_comment":{"href":"https://api.github.com/repos/andela/thor-ah/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela/thor-ah/pulls/43/commits"},"statuses":{"href":"https://api.github.com/repos/andela/thor-ah/statuses/ab7eb13b0502394d146f70f314dcb15877ec9baa"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"houndci-bot"}}