{"action":"created","comment":{"url":"https://api.github.com/repos/gitpoint/git-point/pulls/comments/168527179","pull_request_review_id":96909901,"id":168527179,"diff_hunk":"@@ -36,7 +36,18 @@ export const getRepository = url => {\n     dispatch({ type: GET_REPOSITORY.PENDING });\n \n     return v3\n-      .getJson(url, accessToken)\n+      .get(url, accessToken)\n+      .then(response => {\n+        let json = {};\n+\n+        if (response.status === 200) {\n+          json = response.json();\n+        } else {\n+          json = response.json().then(err => Promise.reject(err));\n+        }\n+\n+        return json;","path":"src/repository/repository.action.js","position":15,"original_position":15,"commit_id":"e0e5fc82bc1474c8aad538380a2b864690233631","original_commit_id":"e0e5fc82bc1474c8aad538380a2b864690233631","user":{"login":"chinesedfan","id":1736154,"avatar_url":"https://avatars3.githubusercontent.com/u/1736154?v=4","gravatar_id":"","url":"https://api.github.com/users/chinesedfan","html_url":"https://github.com/chinesedfan","followers_url":"https://api.github.com/users/chinesedfan/followers","following_url":"https://api.github.com/users/chinesedfan/following{/other_user}","gists_url":"https://api.github.com/users/chinesedfan/gists{/gist_id}","starred_url":"https://api.github.com/users/chinesedfan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chinesedfan/subscriptions","organizations_url":"https://api.github.com/users/chinesedfan/orgs","repos_url":"https://api.github.com/users/chinesedfan/repos","events_url":"https://api.github.com/users/chinesedfan/events{/privacy}","received_events_url":"https://api.github.com/users/chinesedfan/received_events","type":"User","site_admin":false},"body":"How about writing in one line, `return response.status === 200 ? response.json() : Promise.reject()`?","created_at":"2018-02-15T16:20:23Z","updated_at":"2018-02-15T16:26:48Z","html_url":"https://github.com/gitpoint/git-point/pull/726#discussion_r168527179","pull_request_url":"https://api.github.com/repos/gitpoint/git-point/pulls/726","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/gitpoint/git-point/pulls/comments/168527179"},"html":{"href":"https://github.com/gitpoint/git-point/pull/726#discussion_r168527179"},"pull_request":{"href":"https://api.github.com/repos/gitpoint/git-point/pulls/726"}}},"pull_request":{"url":"https://api.github.com/repos/gitpoint/git-point/pulls/726","id":169019535,"html_url":"https://github.com/gitpoint/git-point/pull/726","diff_url":"https://github.com/gitpoint/git-point/pull/726.diff","patch_url":"https://github.com/gitpoint/git-point/pull/726.patch","issue_url":"https://api.github.com/repos/gitpoint/git-point/issues/726","number":726,"state":"open","locked":false,"title":"fix(repository): fix repo view when repos return 404","user":{"login":"dhamanutd","id":11476348,"avatar_url":"https://avatars1.githubusercontent.com/u/11476348?v=4","gravatar_id":"","url":"https://api.github.com/users/dhamanutd","html_url":"https://github.com/dhamanutd","followers_url":"https://api.github.com/users/dhamanutd/followers","following_url":"https://api.github.com/users/dhamanutd/following{/other_user}","gists_url":"https://api.github.com/users/dhamanutd/gists{/gist_id}","starred_url":"https://api.github.com/users/dhamanutd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhamanutd/subscriptions","organizations_url":"https://api.github.com/users/dhamanutd/orgs","repos_url":"https://api.github.com/users/dhamanutd/repos","events_url":"https://api.github.com/users/dhamanutd/events{/privacy}","received_events_url":"https://api.github.com/users/dhamanutd/received_events","type":"User","site_admin":false},"body":"instead of blank view, now will show not found message when error 404\r\n\r\nBREAKING CHANGE: fix repository view when the repos 404 not found\r\n\r\nfix #690\r\n\r\n<!--\r\n  Bonjour!\r\n\r\n  We can't express how grateful we are that you're working on making GitPoint\r\n  better! We're thrilled to take a look at the changes you've made and merge\r\n  them in as soon as possible. Please fill out this template to make the\r\n  reviewal process as quick and smooth as possible. In addition, please make\r\n  sure you remember to add yourself to the contributors list with the following\r\n  command:\r\n\r\n  $ yarn contributors:add\r\n\r\n  Make sure the title of your PR follows our commit style guidelines (see other\r\n  open PR's for reference if you're confused):\r\n\r\n  https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines\r\n\r\n  Thanks again for your hard work!\r\n-->\r\n\r\n| Question         | Response    |\r\n| ---------------- | ----------- |\r\n| Version?         | v1.4.1      |\r\n| Devices tested?  | OnePlus One |\r\n| Bug fix?         | yes      |\r\n| New feature?     | yes/no      |\r\n| Includes tests?  | no      |\r\n| All Tests pass?  | yes      |\r\n| Related ticket?  | #690         |\r\n\r\n---\r\n\r\n## Screenshots\r\n\r\n<!--\r\n  Replace the images in the table below with screenshots of your changes before\r\n  and after. If this is not applicable (i.e. absolutely NO visual changes), feel\r\n  free to delete this section.\r\n-->\r\n\r\n| Before   | After    |\r\n| -------- | -------- |\r\n|![before](https://user-images.githubusercontent.com/11476348/36187610-f53904cc-1178-11e8-8079-5429bef8cc28.png)|![after](https://user-images.githubusercontent.com/11476348/36244528-256c8c8c-1259-11e8-80c0-799cd38db3a0.png)|\r\n\r\n## Description\r\n\r\n<!--\r\n  What changes did you make?\r\n-->\r\n\r\n- [x] Change action reducer `getRepository` to return Promise reject when response status code is not 200 OK\r\n- [x] Make `notFoundMsg` props in the repository screen and component to take string from github api when return 404.\r\n- [x] Change repository reducer in `GET_REPOSITORY.ERROR` to return initialState instead of recent state.\r\n  - In purpose to make repository screen not showing any info from latest state, if there are error 404.\r\n- [x] Create logic to show not found messages, hide owner section, and disabled view code button if error 404.\r\n\r\n<!-- DO NOT MODIFY BELOW THIS LINE -->\r\n<!-- ----------------------------- -->\r\n<!-- GITPOINT_PR -->\r\n","created_at":"2018-02-14T04:29:35Z","updated_at":"2018-02-15T16:26:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c6c025219388462b1d41149897aa1ff318521d2e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/gitpoint/git-point/pulls/726/commits","review_comments_url":"https://api.github.com/repos/gitpoint/git-point/pulls/726/comments","review_comment_url":"https://api.github.com/repos/gitpoint/git-point/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gitpoint/git-point/issues/726/comments","statuses_url":"https://api.github.com/repos/gitpoint/git-point/statuses/e0e5fc82bc1474c8aad538380a2b864690233631","head":{"label":"dhamanutd:repo-screen-problem-when-repo-404","ref":"repo-screen-problem-when-repo-404","sha":"e0e5fc82bc1474c8aad538380a2b864690233631","user":{"login":"dhamanutd","id":11476348,"avatar_url":"https://avatars1.githubusercontent.com/u/11476348?v=4","gravatar_id":"","url":"https://api.github.com/users/dhamanutd","html_url":"https://github.com/dhamanutd","followers_url":"https://api.github.com/users/dhamanutd/followers","following_url":"https://api.github.com/users/dhamanutd/following{/other_user}","gists_url":"https://api.github.com/users/dhamanutd/gists{/gist_id}","starred_url":"https://api.github.com/users/dhamanutd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhamanutd/subscriptions","organizations_url":"https://api.github.com/users/dhamanutd/orgs","repos_url":"https://api.github.com/users/dhamanutd/repos","events_url":"https://api.github.com/users/dhamanutd/events{/privacy}","received_events_url":"https://api.github.com/users/dhamanutd/received_events","type":"User","site_admin":false},"repo":{"id":121338165,"name":"git-point","full_name":"dhamanutd/git-point","owner":{"login":"dhamanutd","id":11476348,"avatar_url":"https://avatars1.githubusercontent.com/u/11476348?v=4","gravatar_id":"","url":"https://api.github.com/users/dhamanutd","html_url":"https://github.com/dhamanutd","followers_url":"https://api.github.com/users/dhamanutd/followers","following_url":"https://api.github.com/users/dhamanutd/following{/other_user}","gists_url":"https://api.github.com/users/dhamanutd/gists{/gist_id}","starred_url":"https://api.github.com/users/dhamanutd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhamanutd/subscriptions","organizations_url":"https://api.github.com/users/dhamanutd/orgs","repos_url":"https://api.github.com/users/dhamanutd/repos","events_url":"https://api.github.com/users/dhamanutd/events{/privacy}","received_events_url":"https://api.github.com/users/dhamanutd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dhamanutd/git-point","description":"GitHub in your pocket :iphone:","fork":true,"url":"https://api.github.com/repos/dhamanutd/git-point","forks_url":"https://api.github.com/repos/dhamanutd/git-point/forks","keys_url":"https://api.github.com/repos/dhamanutd/git-point/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dhamanutd/git-point/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dhamanutd/git-point/teams","hooks_url":"https://api.github.com/repos/dhamanutd/git-point/hooks","issue_events_url":"https://api.github.com/repos/dhamanutd/git-point/issues/events{/number}","events_url":"https://api.github.com/repos/dhamanutd/git-point/events","assignees_url":"https://api.github.com/repos/dhamanutd/git-point/assignees{/user}","branches_url":"https://api.github.com/repos/dhamanutd/git-point/branches{/branch}","tags_url":"https://api.github.com/repos/dhamanutd/git-point/tags","blobs_url":"https://api.github.com/repos/dhamanutd/git-point/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dhamanutd/git-point/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dhamanutd/git-point/git/refs{/sha}","trees_url":"https://api.github.com/repos/dhamanutd/git-point/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dhamanutd/git-point/statuses/{sha}","languages_url":"https://api.github.com/repos/dhamanutd/git-point/languages","stargazers_url":"https://api.github.com/repos/dhamanutd/git-point/stargazers","contributors_url":"https://api.github.com/repos/dhamanutd/git-point/contributors","subscribers_url":"https://api.github.com/repos/dhamanutd/git-point/subscribers","subscription_url":"https://api.github.com/repos/dhamanutd/git-point/subscription","commits_url":"https://api.github.com/repos/dhamanutd/git-point/commits{/sha}","git_commits_url":"https://api.github.com/repos/dhamanutd/git-point/git/commits{/sha}","comments_url":"https://api.github.com/repos/dhamanutd/git-point/comments{/number}","issue_comment_url":"https://api.github.com/repos/dhamanutd/git-point/issues/comments{/number}","contents_url":"https://api.github.com/repos/dhamanutd/git-point/contents/{+path}","compare_url":"https://api.github.com/repos/dhamanutd/git-point/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dhamanutd/git-point/merges","archive_url":"https://api.github.com/repos/dhamanutd/git-point/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dhamanutd/git-point/downloads","issues_url":"https://api.github.com/repos/dhamanutd/git-point/issues{/number}","pulls_url":"https://api.github.com/repos/dhamanutd/git-point/pulls{/number}","milestones_url":"https://api.github.com/repos/dhamanutd/git-point/milestones{/number}","notifications_url":"https://api.github.com/repos/dhamanutd/git-point/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dhamanutd/git-point/labels{/name}","releases_url":"https://api.github.com/repos/dhamanutd/git-point/releases{/id}","deployments_url":"https://api.github.com/repos/dhamanutd/git-point/deployments","created_at":"2018-02-13T04:23:09Z","updated_at":"2018-02-13T04:23:12Z","pushed_at":"2018-02-15T06:55:17Z","git_url":"git://github.com/dhamanutd/git-point.git","ssh_url":"git@github.com:dhamanutd/git-point.git","clone_url":"https://github.com/dhamanutd/git-point.git","svn_url":"https://github.com/dhamanutd/git-point","homepage":"https://gitpoint.co/","size":4651,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"gitpoint:master","ref":"master","sha":"ef4756b199ad8dc075e3c1c2ae7411e98f07c4c3","user":{"login":"gitpoint","id":30082377,"avatar_url":"https://avatars0.githubusercontent.com/u/30082377?v=4","gravatar_id":"","url":"https://api.github.com/users/gitpoint","html_url":"https://github.com/gitpoint","followers_url":"https://api.github.com/users/gitpoint/followers","following_url":"https://api.github.com/users/gitpoint/following{/other_user}","gists_url":"https://api.github.com/users/gitpoint/gists{/gist_id}","starred_url":"https://api.github.com/users/gitpoint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gitpoint/subscriptions","organizations_url":"https://api.github.com/users/gitpoint/orgs","repos_url":"https://api.github.com/users/gitpoint/repos","events_url":"https://api.github.com/users/gitpoint/events{/privacy}","received_events_url":"https://api.github.com/users/gitpoint/received_events","type":"Organization","site_admin":false},"repo":{"id":86202845,"name":"git-point","full_name":"gitpoint/git-point","owner":{"login":"gitpoint","id":30082377,"avatar_url":"https://avatars0.githubusercontent.com/u/30082377?v=4","gravatar_id":"","url":"https://api.github.com/users/gitpoint","html_url":"https://github.com/gitpoint","followers_url":"https://api.github.com/users/gitpoint/followers","following_url":"https://api.github.com/users/gitpoint/following{/other_user}","gists_url":"https://api.github.com/users/gitpoint/gists{/gist_id}","starred_url":"https://api.github.com/users/gitpoint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gitpoint/subscriptions","organizations_url":"https://api.github.com/users/gitpoint/orgs","repos_url":"https://api.github.com/users/gitpoint/repos","events_url":"https://api.github.com/users/gitpoint/events{/privacy}","received_events_url":"https://api.github.com/users/gitpoint/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gitpoint/git-point","description":"GitHub in your pocket :iphone:","fork":false,"url":"https://api.github.com/repos/gitpoint/git-point","forks_url":"https://api.github.com/repos/gitpoint/git-point/forks","keys_url":"https://api.github.com/repos/gitpoint/git-point/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gitpoint/git-point/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gitpoint/git-point/teams","hooks_url":"https://api.github.com/repos/gitpoint/git-point/hooks","issue_events_url":"https://api.github.com/repos/gitpoint/git-point/issues/events{/number}","events_url":"https://api.github.com/repos/gitpoint/git-point/events","assignees_url":"https://api.github.com/repos/gitpoint/git-point/assignees{/user}","branches_url":"https://api.github.com/repos/gitpoint/git-point/branches{/branch}","tags_url":"https://api.github.com/repos/gitpoint/git-point/tags","blobs_url":"https://api.github.com/repos/gitpoint/git-point/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gitpoint/git-point/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gitpoint/git-point/git/refs{/sha}","trees_url":"https://api.github.com/repos/gitpoint/git-point/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gitpoint/git-point/statuses/{sha}","languages_url":"https://api.github.com/repos/gitpoint/git-point/languages","stargazers_url":"https://api.github.com/repos/gitpoint/git-point/stargazers","contributors_url":"https://api.github.com/repos/gitpoint/git-point/contributors","subscribers_url":"https://api.github.com/repos/gitpoint/git-point/subscribers","subscription_url":"https://api.github.com/repos/gitpoint/git-point/subscription","commits_url":"https://api.github.com/repos/gitpoint/git-point/commits{/sha}","git_commits_url":"https://api.github.com/repos/gitpoint/git-point/git/commits{/sha}","comments_url":"https://api.github.com/repos/gitpoint/git-point/comments{/number}","issue_comment_url":"https://api.github.com/repos/gitpoint/git-point/issues/comments{/number}","contents_url":"https://api.github.com/repos/gitpoint/git-point/contents/{+path}","compare_url":"https://api.github.com/repos/gitpoint/git-point/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gitpoint/git-point/merges","archive_url":"https://api.github.com/repos/gitpoint/git-point/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gitpoint/git-point/downloads","issues_url":"https://api.github.com/repos/gitpoint/git-point/issues{/number}","pulls_url":"https://api.github.com/repos/gitpoint/git-point/pulls{/number}","milestones_url":"https://api.github.com/repos/gitpoint/git-point/milestones{/number}","notifications_url":"https://api.github.com/repos/gitpoint/git-point/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gitpoint/git-point/labels{/name}","releases_url":"https://api.github.com/repos/gitpoint/git-point/releases{/id}","deployments_url":"https://api.github.com/repos/gitpoint/git-point/deployments","created_at":"2017-03-26T02:45:46Z","updated_at":"2018-02-15T10:16:17Z","pushed_at":"2018-02-15T06:55:18Z","git_url":"git://github.com/gitpoint/git-point.git","ssh_url":"git@github.com:gitpoint/git-point.git","clone_url":"https://github.com/gitpoint/git-point.git","svn_url":"https://github.com/gitpoint/git-point","homepage":"https://gitpoint.co/","size":4548,"stargazers_count":3256,"watchers_count":3256,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":358,"mirror_url":null,"archived":false,"open_issues_count":121,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":358,"open_issues":121,"watchers":3256,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gitpoint/git-point/pulls/726"},"html":{"href":"https://github.com/gitpoint/git-point/pull/726"},"issue":{"href":"https://api.github.com/repos/gitpoint/git-point/issues/726"},"comments":{"href":"https://api.github.com/repos/gitpoint/git-point/issues/726/comments"},"review_comments":{"href":"https://api.github.com/repos/gitpoint/git-point/pulls/726/comments"},"review_comment":{"href":"https://api.github.com/repos/gitpoint/git-point/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gitpoint/git-point/pulls/726/commits"},"statuses":{"href":"https://api.github.com/repos/gitpoint/git-point/statuses/e0e5fc82bc1474c8aad538380a2b864690233631"}},"author_association":"NONE"}}
{"actor":{"display_login":"chinesedfan"}}