{"action":"created","comment":{"url":"https://api.github.com/repos/Tas-Kit/webmain/pulls/comments/186306765","pull_request_review_id":117859039,"id":186306765,"diff_hunk":"@@ -5,21 +5,45 @@ if (typeof window !== 'undefined') {\n   baseUrl = location.protocol + '//' + location.host + '/api/v1'; // (or whatever)\n }\n \n-const fetchTasks = () => {\n+export const fetchTasks = () => {\n   return fetch(`${baseUrl}/task/?format=json`, {\n     headers: {\n       'Content-Type': 'application/json',\n       Accept: 'application/json'\n     },\n     credentials: 'include'\n+  }).then(res => {\n+    if (res.ok) {\n+      return res.json();\n+    } else {\n+      console.log(res);\n+      throw new Error('Failed to fetch tasks');\n+    }\n+  });\n+};\n+\n+export const fetchTaskGraph = taskId => {\n+  return fetch(`${baseUrl}/task/graph/${taskId}`, {\n+    headers: {\n+      'Content-Type': 'application/json',\n+      Accept: 'application/json'\n+    },\n+    credentials: 'include'\n+  }).then(res => {\n+    if (res.ok) {\n+      return res.json();\n+    } else {","path":"src/utils/api.js","position":32,"original_position":32,"commit_id":"12355c0d880ecb5862dfdfbdef5d705f37e9bc14","original_commit_id":"12355c0d880ecb5862dfdfbdef5d705f37e9bc14","user":{"login":"Lazy-Y","id":9397479,"avatar_url":"https://avatars1.githubusercontent.com/u/9397479?v=4","gravatar_id":"","url":"https://api.github.com/users/Lazy-Y","html_url":"https://github.com/Lazy-Y","followers_url":"https://api.github.com/users/Lazy-Y/followers","following_url":"https://api.github.com/users/Lazy-Y/following{/other_user}","gists_url":"https://api.github.com/users/Lazy-Y/gists{/gist_id}","starred_url":"https://api.github.com/users/Lazy-Y/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lazy-Y/subscriptions","organizations_url":"https://api.github.com/users/Lazy-Y/orgs","repos_url":"https://api.github.com/users/Lazy-Y/repos","events_url":"https://api.github.com/users/Lazy-Y/events{/privacy}","received_events_url":"https://api.github.com/users/Lazy-Y/received_events","type":"User","site_admin":false},"body":"得handle一下timeout的情况，如果一个user太长时间没有activity了我们会自动把这个user登出。你可以把浏览器的cookie删除了来produce这个情况。这种情况我们得把user redirect到Login的界面","created_at":"2018-05-06T23:27:34Z","updated_at":"2018-05-06T23:27:34Z","html_url":"https://github.com/Tas-Kit/webmain/pull/3#discussion_r186306765","pull_request_url":"https://api.github.com/repos/Tas-Kit/webmain/pulls/3","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Tas-Kit/webmain/pulls/comments/186306765"},"html":{"href":"https://github.com/Tas-Kit/webmain/pull/3#discussion_r186306765"},"pull_request":{"href":"https://api.github.com/repos/Tas-Kit/webmain/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/Tas-Kit/webmain/pulls/3","id":186230203,"html_url":"https://github.com/Tas-Kit/webmain/pull/3","diff_url":"https://github.com/Tas-Kit/webmain/pull/3.diff","patch_url":"https://github.com/Tas-Kit/webmain/pull/3.patch","issue_url":"https://api.github.com/repos/Tas-Kit/webmain/issues/3","number":3,"state":"open","locked":false,"title":"Invitation","user":{"login":"tianhanl","id":16639742,"avatar_url":"https://avatars1.githubusercontent.com/u/16639742?v=4","gravatar_id":"","url":"https://api.github.com/users/tianhanl","html_url":"https://github.com/tianhanl","followers_url":"https://api.github.com/users/tianhanl/followers","following_url":"https://api.github.com/users/tianhanl/following{/other_user}","gists_url":"https://api.github.com/users/tianhanl/gists{/gist_id}","starred_url":"https://api.github.com/users/tianhanl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tianhanl/subscriptions","organizations_url":"https://api.github.com/users/tianhanl/orgs","repos_url":"https://api.github.com/users/tianhanl/repos","events_url":"https://api.github.com/users/tianhanl/events{/privacy}","received_events_url":"https://api.github.com/users/tianhanl/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-05-06T22:36:28Z","updated_at":"2018-05-06T23:27:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6cccbd9b96281b2fde81746df86ea9c1d51bad58","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Tas-Kit/webmain/pulls/3/commits","review_comments_url":"https://api.github.com/repos/Tas-Kit/webmain/pulls/3/comments","review_comment_url":"https://api.github.com/repos/Tas-Kit/webmain/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Tas-Kit/webmain/issues/3/comments","statuses_url":"https://api.github.com/repos/Tas-Kit/webmain/statuses/12355c0d880ecb5862dfdfbdef5d705f37e9bc14","head":{"label":"Tas-Kit:invitation","ref":"invitation","sha":"12355c0d880ecb5862dfdfbdef5d705f37e9bc14","user":{"login":"Tas-Kit","id":37892539,"avatar_url":"https://avatars1.githubusercontent.com/u/37892539?v=4","gravatar_id":"","url":"https://api.github.com/users/Tas-Kit","html_url":"https://github.com/Tas-Kit","followers_url":"https://api.github.com/users/Tas-Kit/followers","following_url":"https://api.github.com/users/Tas-Kit/following{/other_user}","gists_url":"https://api.github.com/users/Tas-Kit/gists{/gist_id}","starred_url":"https://api.github.com/users/Tas-Kit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tas-Kit/subscriptions","organizations_url":"https://api.github.com/users/Tas-Kit/orgs","repos_url":"https://api.github.com/users/Tas-Kit/repos","events_url":"https://api.github.com/users/Tas-Kit/events{/privacy}","received_events_url":"https://api.github.com/users/Tas-Kit/received_events","type":"Organization","site_admin":false},"repo":{"id":130163997,"name":"webmain","full_name":"Tas-Kit/webmain","owner":{"login":"Tas-Kit","id":37892539,"avatar_url":"https://avatars1.githubusercontent.com/u/37892539?v=4","gravatar_id":"","url":"https://api.github.com/users/Tas-Kit","html_url":"https://github.com/Tas-Kit","followers_url":"https://api.github.com/users/Tas-Kit/followers","following_url":"https://api.github.com/users/Tas-Kit/following{/other_user}","gists_url":"https://api.github.com/users/Tas-Kit/gists{/gist_id}","starred_url":"https://api.github.com/users/Tas-Kit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tas-Kit/subscriptions","organizations_url":"https://api.github.com/users/Tas-Kit/orgs","repos_url":"https://api.github.com/users/Tas-Kit/repos","events_url":"https://api.github.com/users/Tas-Kit/events{/privacy}","received_events_url":"https://api.github.com/users/Tas-Kit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Tas-Kit/webmain","description":null,"fork":false,"url":"https://api.github.com/repos/Tas-Kit/webmain","forks_url":"https://api.github.com/repos/Tas-Kit/webmain/forks","keys_url":"https://api.github.com/repos/Tas-Kit/webmain/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Tas-Kit/webmain/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Tas-Kit/webmain/teams","hooks_url":"https://api.github.com/repos/Tas-Kit/webmain/hooks","issue_events_url":"https://api.github.com/repos/Tas-Kit/webmain/issues/events{/number}","events_url":"https://api.github.com/repos/Tas-Kit/webmain/events","assignees_url":"https://api.github.com/repos/Tas-Kit/webmain/assignees{/user}","branches_url":"https://api.github.com/repos/Tas-Kit/webmain/branches{/branch}","tags_url":"https://api.github.com/repos/Tas-Kit/webmain/tags","blobs_url":"https://api.github.com/repos/Tas-Kit/webmain/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Tas-Kit/webmain/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Tas-Kit/webmain/git/refs{/sha}","trees_url":"https://api.github.com/repos/Tas-Kit/webmain/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Tas-Kit/webmain/statuses/{sha}","languages_url":"https://api.github.com/repos/Tas-Kit/webmain/languages","stargazers_url":"https://api.github.com/repos/Tas-Kit/webmain/stargazers","contributors_url":"https://api.github.com/repos/Tas-Kit/webmain/contributors","subscribers_url":"https://api.github.com/repos/Tas-Kit/webmain/subscribers","subscription_url":"https://api.github.com/repos/Tas-Kit/webmain/subscription","commits_url":"https://api.github.com/repos/Tas-Kit/webmain/commits{/sha}","git_commits_url":"https://api.github.com/repos/Tas-Kit/webmain/git/commits{/sha}","comments_url":"https://api.github.com/repos/Tas-Kit/webmain/comments{/number}","issue_comment_url":"https://api.github.com/repos/Tas-Kit/webmain/issues/comments{/number}","contents_url":"https://api.github.com/repos/Tas-Kit/webmain/contents/{+path}","compare_url":"https://api.github.com/repos/Tas-Kit/webmain/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Tas-Kit/webmain/merges","archive_url":"https://api.github.com/repos/Tas-Kit/webmain/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Tas-Kit/webmain/downloads","issues_url":"https://api.github.com/repos/Tas-Kit/webmain/issues{/number}","pulls_url":"https://api.github.com/repos/Tas-Kit/webmain/pulls{/number}","milestones_url":"https://api.github.com/repos/Tas-Kit/webmain/milestones{/number}","notifications_url":"https://api.github.com/repos/Tas-Kit/webmain/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Tas-Kit/webmain/labels{/name}","releases_url":"https://api.github.com/repos/Tas-Kit/webmain/releases{/id}","deployments_url":"https://api.github.com/repos/Tas-Kit/webmain/deployments","created_at":"2018-04-19T05:36:14Z","updated_at":"2018-05-06T04:28:23Z","pushed_at":"2018-05-06T22:37:08Z","git_url":"git://github.com/Tas-Kit/webmain.git","ssh_url":"git@github.com:Tas-Kit/webmain.git","clone_url":"https://github.com/Tas-Kit/webmain.git","svn_url":"https://github.com/Tas-Kit/webmain","homepage":null,"size":158,"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":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Tas-Kit:master","ref":"master","sha":"a4628957a58e985a9049333874d5c0992a2ed77f","user":{"login":"Tas-Kit","id":37892539,"avatar_url":"https://avatars1.githubusercontent.com/u/37892539?v=4","gravatar_id":"","url":"https://api.github.com/users/Tas-Kit","html_url":"https://github.com/Tas-Kit","followers_url":"https://api.github.com/users/Tas-Kit/followers","following_url":"https://api.github.com/users/Tas-Kit/following{/other_user}","gists_url":"https://api.github.com/users/Tas-Kit/gists{/gist_id}","starred_url":"https://api.github.com/users/Tas-Kit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tas-Kit/subscriptions","organizations_url":"https://api.github.com/users/Tas-Kit/orgs","repos_url":"https://api.github.com/users/Tas-Kit/repos","events_url":"https://api.github.com/users/Tas-Kit/events{/privacy}","received_events_url":"https://api.github.com/users/Tas-Kit/received_events","type":"Organization","site_admin":false},"repo":{"id":130163997,"name":"webmain","full_name":"Tas-Kit/webmain","owner":{"login":"Tas-Kit","id":37892539,"avatar_url":"https://avatars1.githubusercontent.com/u/37892539?v=4","gravatar_id":"","url":"https://api.github.com/users/Tas-Kit","html_url":"https://github.com/Tas-Kit","followers_url":"https://api.github.com/users/Tas-Kit/followers","following_url":"https://api.github.com/users/Tas-Kit/following{/other_user}","gists_url":"https://api.github.com/users/Tas-Kit/gists{/gist_id}","starred_url":"https://api.github.com/users/Tas-Kit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tas-Kit/subscriptions","organizations_url":"https://api.github.com/users/Tas-Kit/orgs","repos_url":"https://api.github.com/users/Tas-Kit/repos","events_url":"https://api.github.com/users/Tas-Kit/events{/privacy}","received_events_url":"https://api.github.com/users/Tas-Kit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Tas-Kit/webmain","description":null,"fork":false,"url":"https://api.github.com/repos/Tas-Kit/webmain","forks_url":"https://api.github.com/repos/Tas-Kit/webmain/forks","keys_url":"https://api.github.com/repos/Tas-Kit/webmain/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Tas-Kit/webmain/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Tas-Kit/webmain/teams","hooks_url":"https://api.github.com/repos/Tas-Kit/webmain/hooks","issue_events_url":"https://api.github.com/repos/Tas-Kit/webmain/issues/events{/number}","events_url":"https://api.github.com/repos/Tas-Kit/webmain/events","assignees_url":"https://api.github.com/repos/Tas-Kit/webmain/assignees{/user}","branches_url":"https://api.github.com/repos/Tas-Kit/webmain/branches{/branch}","tags_url":"https://api.github.com/repos/Tas-Kit/webmain/tags","blobs_url":"https://api.github.com/repos/Tas-Kit/webmain/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Tas-Kit/webmain/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Tas-Kit/webmain/git/refs{/sha}","trees_url":"https://api.github.com/repos/Tas-Kit/webmain/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Tas-Kit/webmain/statuses/{sha}","languages_url":"https://api.github.com/repos/Tas-Kit/webmain/languages","stargazers_url":"https://api.github.com/repos/Tas-Kit/webmain/stargazers","contributors_url":"https://api.github.com/repos/Tas-Kit/webmain/contributors","subscribers_url":"https://api.github.com/repos/Tas-Kit/webmain/subscribers","subscription_url":"https://api.github.com/repos/Tas-Kit/webmain/subscription","commits_url":"https://api.github.com/repos/Tas-Kit/webmain/commits{/sha}","git_commits_url":"https://api.github.com/repos/Tas-Kit/webmain/git/commits{/sha}","comments_url":"https://api.github.com/repos/Tas-Kit/webmain/comments{/number}","issue_comment_url":"https://api.github.com/repos/Tas-Kit/webmain/issues/comments{/number}","contents_url":"https://api.github.com/repos/Tas-Kit/webmain/contents/{+path}","compare_url":"https://api.github.com/repos/Tas-Kit/webmain/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Tas-Kit/webmain/merges","archive_url":"https://api.github.com/repos/Tas-Kit/webmain/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Tas-Kit/webmain/downloads","issues_url":"https://api.github.com/repos/Tas-Kit/webmain/issues{/number}","pulls_url":"https://api.github.com/repos/Tas-Kit/webmain/pulls{/number}","milestones_url":"https://api.github.com/repos/Tas-Kit/webmain/milestones{/number}","notifications_url":"https://api.github.com/repos/Tas-Kit/webmain/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Tas-Kit/webmain/labels{/name}","releases_url":"https://api.github.com/repos/Tas-Kit/webmain/releases{/id}","deployments_url":"https://api.github.com/repos/Tas-Kit/webmain/deployments","created_at":"2018-04-19T05:36:14Z","updated_at":"2018-05-06T04:28:23Z","pushed_at":"2018-05-06T22:37:08Z","git_url":"git://github.com/Tas-Kit/webmain.git","ssh_url":"git@github.com:Tas-Kit/webmain.git","clone_url":"https://github.com/Tas-Kit/webmain.git","svn_url":"https://github.com/Tas-Kit/webmain","homepage":null,"size":158,"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":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Tas-Kit/webmain/pulls/3"},"html":{"href":"https://github.com/Tas-Kit/webmain/pull/3"},"issue":{"href":"https://api.github.com/repos/Tas-Kit/webmain/issues/3"},"comments":{"href":"https://api.github.com/repos/Tas-Kit/webmain/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/Tas-Kit/webmain/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/Tas-Kit/webmain/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Tas-Kit/webmain/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/Tas-Kit/webmain/statuses/12355c0d880ecb5862dfdfbdef5d705f37e9bc14"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"Lazy-Y"}}