{"action":"created","comment":{"url":"https://api.github.com/repos/andela/ah-frontend-targaryen/pulls/comments/235415557","pull_request_review_id":177271113,"id":235415557,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNTQxNTU1Nw==","diff_hunk":"@@ -113,3 +117,28 @@ export const likeDislike = (payload, slug) => dispatch => {\n       return toast.error(error.response.data.detail, { autoClose: false, hideProgressBar: true });\n     });\n };\n+\n+export const updateArticle = (slug, newData) => dispatch => {\n+  toast.dismiss();\n+  dispatch(editArticleInititated(true));\n+  return axiosInstance\n+    .put(`/api/articles/${slug}/`, newData)\n+    .then(response => {\n+      dispatch(editArticleSuccess(true));\n+      toast.success(\n+        response.data.message,\n+        { autoClose: 3500, hideProgressBar: true },\n+      );\n+    })\n+    .catch((error) => {\n+      let errorMessage = '';\n+      if (error.response.status === 403) {\n+        errorMessage = 'Re-login and try again';\n+      }\n+      if (error.response.status === 404) {\n+        errorMessage = 'Please enter valid text';","path":"src/actions/articleActions.js","position":54,"original_position":54,"commit_id":"7316f3939fabef8fbdee16ac9307f16b78ec59b3","original_commit_id":"7316f3939fabef8fbdee16ac9307f16b78ec59b3","user":{"login":"dondrzzy","id":25340897,"node_id":"MDQ6VXNlcjI1MzQwODk3","avatar_url":"https://avatars1.githubusercontent.com/u/25340897?v=4","gravatar_id":"","url":"https://api.github.com/users/dondrzzy","html_url":"https://github.com/dondrzzy","followers_url":"https://api.github.com/users/dondrzzy/followers","following_url":"https://api.github.com/users/dondrzzy/following{/other_user}","gists_url":"https://api.github.com/users/dondrzzy/gists{/gist_id}","starred_url":"https://api.github.com/users/dondrzzy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dondrzzy/subscriptions","organizations_url":"https://api.github.com/users/dondrzzy/orgs","repos_url":"https://api.github.com/users/dondrzzy/repos","events_url":"https://api.github.com/users/dondrzzy/events{/privacy}","received_events_url":"https://api.github.com/users/dondrzzy/received_events","type":"User","site_admin":false},"body":"Does `valid text` help the user determine whether its the `title, body or description` with the issue? Is there an error message that returns with this error response?","created_at":"2018-11-21T14:48:03Z","updated_at":"2018-11-21T14:52:44Z","html_url":"https://github.com/andela/ah-frontend-targaryen/pull/28#discussion_r235415557","pull_request_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/pulls/28","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/andela/ah-frontend-targaryen/pulls/comments/235415557"},"html":{"href":"https://github.com/andela/ah-frontend-targaryen/pull/28#discussion_r235415557"},"pull_request":{"href":"https://api.github.com/repos/andela/ah-frontend-targaryen/pulls/28"}}},"pull_request":{"url":"https://api.github.com/repos/andela/ah-frontend-targaryen/pulls/28","id":231319958,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMxMzE5OTU4","html_url":"https://github.com/andela/ah-frontend-targaryen/pull/28","diff_url":"https://github.com/andela/ah-frontend-targaryen/pull/28.diff","patch_url":"https://github.com/andela/ah-frontend-targaryen/pull/28.patch","issue_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/issues/28","number":28,"state":"open","locked":false,"title":"#161776762 Edit articles","user":{"login":"samuelbwambale","id":31615608,"node_id":"MDQ6VXNlcjMxNjE1NjA4","avatar_url":"https://avatars3.githubusercontent.com/u/31615608?v=4","gravatar_id":"","url":"https://api.github.com/users/samuelbwambale","html_url":"https://github.com/samuelbwambale","followers_url":"https://api.github.com/users/samuelbwambale/followers","following_url":"https://api.github.com/users/samuelbwambale/following{/other_user}","gists_url":"https://api.github.com/users/samuelbwambale/gists{/gist_id}","starred_url":"https://api.github.com/users/samuelbwambale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samuelbwambale/subscriptions","organizations_url":"https://api.github.com/users/samuelbwambale/orgs","repos_url":"https://api.github.com/users/samuelbwambale/repos","events_url":"https://api.github.com/users/samuelbwambale/events{/privacy}","received_events_url":"https://api.github.com/users/samuelbwambale/received_events","type":"User","site_admin":false},"body":"### What does this PR do?\r\n\r\nEnables users to edit articles which they authored\r\n\r\n#### Description of Task to be completed?\r\n\r\nCurrently, the users are unable to update articles. \r\n\r\nThis feature enables users to edit articles. Users can only edit the articles they authored.\r\n\r\n#### How should this be manually tested?\r\n\r\nPull the changes on a new branch and run `npm install`\r\nrun `npm start` to start the server\r\nLog into the app using a registered email and password\r\nClick on profile and select `New Article` to add a new article\r\nSelect the created article from the list of articles by clicking on `Read more` link\r\nOn loading the article, click on edit button and change any of the fields\r\nClick on save button and see the updated article on the profile\r\n\r\n\r\n#### What are the relevant pivotal tracker stories?\r\n\r\n- [#161776762](https://www.pivotaltracker.com/story/show/161776762)\r\n\r\n#### Screenshots (if appropriate)\r\n\r\n\r\n## Checklist: I completed these to help reviewers\r\n\r\n- [x] My IDE is configured to follow the [**ESlint Conventions**](https://github.com/eslint/eslint)\r\n\r\n\r\n- [x] I have **added tests** to cover my changes.\r\n\r\n- [x] All new and existing **tests passed**.\r\n\r\n- [x] My pull request is **based on the latest changes** of the develop branch.\r\n","created_at":"2018-11-15T20:12:32Z","updated_at":"2018-11-21T14:52:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9970cf7d097ae7eda07a16fd0a74b491daeeb629","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/pulls/28/commits","review_comments_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/pulls/28/comments","review_comment_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/issues/28/comments","statuses_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/statuses/7316f3939fabef8fbdee16ac9307f16b78ec59b3","head":{"label":"andela:ft-edit-article-161776762","ref":"ft-edit-article-161776762","sha":"7316f3939fabef8fbdee16ac9307f16b78ec59b3","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":154833762,"node_id":"MDEwOlJlcG9zaXRvcnkxNTQ4MzM3NjI=","name":"ah-frontend-targaryen","full_name":"andela/ah-frontend-targaryen","private":false,"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},"html_url":"https://github.com/andela/ah-frontend-targaryen","description":null,"fork":false,"url":"https://api.github.com/repos/andela/ah-frontend-targaryen","forks_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/forks","keys_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/teams","hooks_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/hooks","issue_events_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/issues/events{/number}","events_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/events","assignees_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/assignees{/user}","branches_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/branches{/branch}","tags_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/tags","blobs_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/languages","stargazers_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/stargazers","contributors_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/contributors","subscribers_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/subscribers","subscription_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/subscription","commits_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/contents/{+path}","compare_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/merges","archive_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/downloads","issues_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/issues{/number}","pulls_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/labels{/name}","releases_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/releases{/id}","deployments_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/deployments","created_at":"2018-10-26T12:48:12Z","updated_at":"2018-11-20T09:48:22Z","pushed_at":"2018-11-21T14:49:46Z","git_url":"git://github.com/andela/ah-frontend-targaryen.git","ssh_url":"git@github.com:andela/ah-frontend-targaryen.git","clone_url":"https://github.com/andela/ah-frontend-targaryen.git","svn_url":"https://github.com/andela/ah-frontend-targaryen","homepage":null,"size":5654,"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":5,"license":null,"forks":0,"open_issues":5,"watchers":0,"default_branch":"develop"}},"base":{"label":"andela:develop","ref":"develop","sha":"77fa4603f798c61f38aab82906a02551a79d9ee1","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":154833762,"node_id":"MDEwOlJlcG9zaXRvcnkxNTQ4MzM3NjI=","name":"ah-frontend-targaryen","full_name":"andela/ah-frontend-targaryen","private":false,"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},"html_url":"https://github.com/andela/ah-frontend-targaryen","description":null,"fork":false,"url":"https://api.github.com/repos/andela/ah-frontend-targaryen","forks_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/forks","keys_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/teams","hooks_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/hooks","issue_events_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/issues/events{/number}","events_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/events","assignees_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/assignees{/user}","branches_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/branches{/branch}","tags_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/tags","blobs_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/languages","stargazers_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/stargazers","contributors_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/contributors","subscribers_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/subscribers","subscription_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/subscription","commits_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/contents/{+path}","compare_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/merges","archive_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/downloads","issues_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/issues{/number}","pulls_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/labels{/name}","releases_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/releases{/id}","deployments_url":"https://api.github.com/repos/andela/ah-frontend-targaryen/deployments","created_at":"2018-10-26T12:48:12Z","updated_at":"2018-11-20T09:48:22Z","pushed_at":"2018-11-21T14:49:46Z","git_url":"git://github.com/andela/ah-frontend-targaryen.git","ssh_url":"git@github.com:andela/ah-frontend-targaryen.git","clone_url":"https://github.com/andela/ah-frontend-targaryen.git","svn_url":"https://github.com/andela/ah-frontend-targaryen","homepage":null,"size":5654,"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":5,"license":null,"forks":0,"open_issues":5,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/andela/ah-frontend-targaryen/pulls/28"},"html":{"href":"https://github.com/andela/ah-frontend-targaryen/pull/28"},"issue":{"href":"https://api.github.com/repos/andela/ah-frontend-targaryen/issues/28"},"comments":{"href":"https://api.github.com/repos/andela/ah-frontend-targaryen/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/andela/ah-frontend-targaryen/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/andela/ah-frontend-targaryen/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela/ah-frontend-targaryen/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/andela/ah-frontend-targaryen/statuses/7316f3939fabef8fbdee16ac9307f16b78ec59b3"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"dondrzzy"}}