{"action":"created","comment":{"url":"https://api.github.com/repos/andela/rivendell-ah-client/pulls/comments/215530837","pull_request_review_id":152813561,"id":215530837,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNTUzMDgzNw==","diff_hunk":"@@ -0,0 +1,47 @@\n+import axios from 'axios';\n+\n+let apiUrl = 'https://authorhaven.herokuapp.com/api';\n+if(process.env.NODE_ENV === 'development') {\n+  apiUrl = 'http://localhost:3000/api';\n+}\n+\n+function axiosInstance(headers, body) {\n+  const axiosInstance = axios.create({\n+    baseURL: apiUrl,\n+    headers,\n+    body,\n+  })\n+  return axiosInstance;\n+}\n+\n+function apiCalls(axiosInStance, method, path, headers, body) {\n+  let response;\n+  if (method === 'get') {\n+    axiosInStance(headers, body).get(path)\n+    .then(res => {\n+      response = res.data;\n+    })\n+    .catch(error => error);\n+  }\n+  if (method === 'post') {\n+      axiosInStance(headers, body).post(path)\n+    .then(res => res.data)\n+    .catch(error => error);\n+  }\n+  if (method === 'put') {\n+    return axiosInStance(headers, body).put(path)\n+    .then(res => res.data)\n+    .catch(error => error);\n+  }\n+  if (method === 'delete') {\n+    return axiosInStance(headers, body).delete(path)\n+    .then(res => res.data)","path":"src/services/requestHandler.js","position":38,"original_position":38,"commit_id":"ecc65ed258f2826b1d15cb02d5dbcd891d9648de","original_commit_id":"ecc65ed258f2826b1d15cb02d5dbcd891d9648de","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":"Expected indentation of 6 spaces but found 4                                         indent","created_at":"2018-09-06T08:04:55Z","updated_at":"2018-09-06T08:04:57Z","html_url":"https://github.com/andela/rivendell-ah-client/pull/10#discussion_r215530837","pull_request_url":"https://api.github.com/repos/andela/rivendell-ah-client/pulls/10","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/andela/rivendell-ah-client/pulls/comments/215530837"},"html":{"href":"https://github.com/andela/rivendell-ah-client/pull/10#discussion_r215530837"},"pull_request":{"href":"https://api.github.com/repos/andela/rivendell-ah-client/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/andela/rivendell-ah-client/pulls/10","id":213528752,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzNTI4NzUy","html_url":"https://github.com/andela/rivendell-ah-client/pull/10","diff_url":"https://github.com/andela/rivendell-ah-client/pull/10.diff","patch_url":"https://github.com/andela/rivendell-ah-client/pull/10.patch","issue_url":"https://api.github.com/repos/andela/rivendell-ah-client/issues/10","number":10,"state":"open","locked":false,"title":"#160283233 set up axios instance","user":{"login":"tutugodfrey","id":30448913,"node_id":"MDQ6VXNlcjMwNDQ4OTEz","avatar_url":"https://avatars1.githubusercontent.com/u/30448913?v=4","gravatar_id":"","url":"https://api.github.com/users/tutugodfrey","html_url":"https://github.com/tutugodfrey","followers_url":"https://api.github.com/users/tutugodfrey/followers","following_url":"https://api.github.com/users/tutugodfrey/following{/other_user}","gists_url":"https://api.github.com/users/tutugodfrey/gists{/gist_id}","starred_url":"https://api.github.com/users/tutugodfrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tutugodfrey/subscriptions","organizations_url":"https://api.github.com/users/tutugodfrey/orgs","repos_url":"https://api.github.com/users/tutugodfrey/repos","events_url":"https://api.github.com/users/tutugodfrey/events{/privacy}","received_events_url":"https://api.github.com/users/tutugodfrey/received_events","type":"User","site_admin":false},"body":"#### What does this PR do?\r\n- Add axios for making API requests\r\n\r\n#### Description of Task to be completed?\r\n- Install axios as project dependencies\r\n- Set up and axios instance\r\n- Add a function for making API requests using axios\r\n\r\n#### How should this be manually tested?\r\n- Clone the repository and in your terminal `npm install` to install dependencies, then run `npm run dev` to start the application in development mode\r\n- When the browser open try clicking the button `Secondary` and check the console for messages\r\n\r\n#### Any background context you want to provide?\r\n- Two functions are defined one is for starting an axios instances which can be use out of the box\r\n- The function apiCalls is accepts the axios instance, and other parameters (header method, body) and make an api call using axios\r\n\r\n#### What are the relevant pivotal tracker stories?\r\n#160283233\r\n\r\n#### Screenshots (if appropriate)\r\n\r\n#### Questions:","created_at":"2018-09-06T08:04:45Z","updated_at":"2018-09-06T08:04:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9ae135aa01d7bfc363e964e9fca261e4ea14343b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/andela/rivendell-ah-client/pulls/10/commits","review_comments_url":"https://api.github.com/repos/andela/rivendell-ah-client/pulls/10/comments","review_comment_url":"https://api.github.com/repos/andela/rivendell-ah-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela/rivendell-ah-client/issues/10/comments","statuses_url":"https://api.github.com/repos/andela/rivendell-ah-client/statuses/ecc65ed258f2826b1d15cb02d5dbcd891d9648de","head":{"label":"andela:feature/160283233/setup-axios-instance","ref":"feature/160283233/setup-axios-instance","sha":"ecc65ed258f2826b1d15cb02d5dbcd891d9648de","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":146319768,"node_id":"MDEwOlJlcG9zaXRvcnkxNDYzMTk3Njg=","name":"rivendell-ah-client","full_name":"andela/rivendell-ah-client","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/rivendell-ah-client","description":null,"fork":false,"url":"https://api.github.com/repos/andela/rivendell-ah-client","forks_url":"https://api.github.com/repos/andela/rivendell-ah-client/forks","keys_url":"https://api.github.com/repos/andela/rivendell-ah-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/rivendell-ah-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/rivendell-ah-client/teams","hooks_url":"https://api.github.com/repos/andela/rivendell-ah-client/hooks","issue_events_url":"https://api.github.com/repos/andela/rivendell-ah-client/issues/events{/number}","events_url":"https://api.github.com/repos/andela/rivendell-ah-client/events","assignees_url":"https://api.github.com/repos/andela/rivendell-ah-client/assignees{/user}","branches_url":"https://api.github.com/repos/andela/rivendell-ah-client/branches{/branch}","tags_url":"https://api.github.com/repos/andela/rivendell-ah-client/tags","blobs_url":"https://api.github.com/repos/andela/rivendell-ah-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/rivendell-ah-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/rivendell-ah-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/rivendell-ah-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/rivendell-ah-client/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/rivendell-ah-client/languages","stargazers_url":"https://api.github.com/repos/andela/rivendell-ah-client/stargazers","contributors_url":"https://api.github.com/repos/andela/rivendell-ah-client/contributors","subscribers_url":"https://api.github.com/repos/andela/rivendell-ah-client/subscribers","subscription_url":"https://api.github.com/repos/andela/rivendell-ah-client/subscription","commits_url":"https://api.github.com/repos/andela/rivendell-ah-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/rivendell-ah-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/rivendell-ah-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/rivendell-ah-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/rivendell-ah-client/contents/{+path}","compare_url":"https://api.github.com/repos/andela/rivendell-ah-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/rivendell-ah-client/merges","archive_url":"https://api.github.com/repos/andela/rivendell-ah-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/rivendell-ah-client/downloads","issues_url":"https://api.github.com/repos/andela/rivendell-ah-client/issues{/number}","pulls_url":"https://api.github.com/repos/andela/rivendell-ah-client/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/rivendell-ah-client/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/rivendell-ah-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/rivendell-ah-client/labels{/name}","releases_url":"https://api.github.com/repos/andela/rivendell-ah-client/releases{/id}","deployments_url":"https://api.github.com/repos/andela/rivendell-ah-client/deployments","created_at":"2018-08-27T15:49:06Z","updated_at":"2018-09-04T12:55:56Z","pushed_at":"2018-09-06T08:04:45Z","git_url":"git://github.com/andela/rivendell-ah-client.git","ssh_url":"git@github.com:andela/rivendell-ah-client.git","clone_url":"https://github.com/andela/rivendell-ah-client.git","svn_url":"https://github.com/andela/rivendell-ah-client","homepage":null,"size":4192,"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,"archived":false,"open_issues_count":4,"license":null,"forks":0,"open_issues":4,"watchers":0,"default_branch":"staging"}},"base":{"label":"andela:staging","ref":"staging","sha":"896a4aad6b70fdbf055c7a2c4c558dec89b39723","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":146319768,"node_id":"MDEwOlJlcG9zaXRvcnkxNDYzMTk3Njg=","name":"rivendell-ah-client","full_name":"andela/rivendell-ah-client","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/rivendell-ah-client","description":null,"fork":false,"url":"https://api.github.com/repos/andela/rivendell-ah-client","forks_url":"https://api.github.com/repos/andela/rivendell-ah-client/forks","keys_url":"https://api.github.com/repos/andela/rivendell-ah-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/rivendell-ah-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/rivendell-ah-client/teams","hooks_url":"https://api.github.com/repos/andela/rivendell-ah-client/hooks","issue_events_url":"https://api.github.com/repos/andela/rivendell-ah-client/issues/events{/number}","events_url":"https://api.github.com/repos/andela/rivendell-ah-client/events","assignees_url":"https://api.github.com/repos/andela/rivendell-ah-client/assignees{/user}","branches_url":"https://api.github.com/repos/andela/rivendell-ah-client/branches{/branch}","tags_url":"https://api.github.com/repos/andela/rivendell-ah-client/tags","blobs_url":"https://api.github.com/repos/andela/rivendell-ah-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/rivendell-ah-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/rivendell-ah-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/rivendell-ah-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/rivendell-ah-client/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/rivendell-ah-client/languages","stargazers_url":"https://api.github.com/repos/andela/rivendell-ah-client/stargazers","contributors_url":"https://api.github.com/repos/andela/rivendell-ah-client/contributors","subscribers_url":"https://api.github.com/repos/andela/rivendell-ah-client/subscribers","subscription_url":"https://api.github.com/repos/andela/rivendell-ah-client/subscription","commits_url":"https://api.github.com/repos/andela/rivendell-ah-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/rivendell-ah-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/rivendell-ah-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/rivendell-ah-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/rivendell-ah-client/contents/{+path}","compare_url":"https://api.github.com/repos/andela/rivendell-ah-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/rivendell-ah-client/merges","archive_url":"https://api.github.com/repos/andela/rivendell-ah-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/rivendell-ah-client/downloads","issues_url":"https://api.github.com/repos/andela/rivendell-ah-client/issues{/number}","pulls_url":"https://api.github.com/repos/andela/rivendell-ah-client/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/rivendell-ah-client/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/rivendell-ah-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/rivendell-ah-client/labels{/name}","releases_url":"https://api.github.com/repos/andela/rivendell-ah-client/releases{/id}","deployments_url":"https://api.github.com/repos/andela/rivendell-ah-client/deployments","created_at":"2018-08-27T15:49:06Z","updated_at":"2018-09-04T12:55:56Z","pushed_at":"2018-09-06T08:04:45Z","git_url":"git://github.com/andela/rivendell-ah-client.git","ssh_url":"git@github.com:andela/rivendell-ah-client.git","clone_url":"https://github.com/andela/rivendell-ah-client.git","svn_url":"https://github.com/andela/rivendell-ah-client","homepage":null,"size":4192,"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,"archived":false,"open_issues_count":4,"license":null,"forks":0,"open_issues":4,"watchers":0,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/andela/rivendell-ah-client/pulls/10"},"html":{"href":"https://github.com/andela/rivendell-ah-client/pull/10"},"issue":{"href":"https://api.github.com/repos/andela/rivendell-ah-client/issues/10"},"comments":{"href":"https://api.github.com/repos/andela/rivendell-ah-client/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/andela/rivendell-ah-client/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/andela/rivendell-ah-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela/rivendell-ah-client/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/andela/rivendell-ah-client/statuses/ecc65ed258f2826b1d15cb02d5dbcd891d9648de"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"houndci-bot"}}