{"action":"created","comment":{"url":"https://api.github.com/repos/paperhive/paperhive-frontend/pulls/comments/52851693","id":52851693,"diff_hunk":"@@ -0,0 +1,46 @@\n+'use strict';\n+\n+export default function(app) {\n+    app.component('starredDocs', {\n+      bindings: {\n+        personId: '<',\n+      },\n+      controller: [\n+        '$scope', '$element', '$attrs', '$http', 'config', 'notificationService',\n+        function($scope, $element, $attrs, $http, config, notificationService) {\n+          const ctrl = this;\n+\n+          $scope.$watch('$ctrl.personId', async function(id) {\n+            if (!id) { return; }\n+            let ret;\n+            try {\n+              ret = await $http.get(\n+                config.apiUrl +\n+                  '/people/' + id + '/stars'\n+              );\n+            } catch (err) {\n+              notificationService.notifications.push({\n+                type: 'error',\n+                message: err.data.message ? err.data.message :\n+                  'could not fetch starred documents (unknown reason)'\n+              });\n+            }\n+            ctrl.starredDocuments = ret.data.documents;","path":"app/components/starred-docs.ts","position":28,"original_position":28,"commit_id":"61ef3f24fc36cb8b69bea44f68e9e60fabdd1df3","original_commit_id":"61ef3f24fc36cb8b69bea44f68e9e60fabdd1df3","user":{"login":"andrenarchy","id":1874116,"avatar_url":"https://avatars.githubusercontent.com/u/1874116?v=3","gravatar_id":"","url":"https://api.github.com/users/andrenarchy","html_url":"https://github.com/andrenarchy","followers_url":"https://api.github.com/users/andrenarchy/followers","following_url":"https://api.github.com/users/andrenarchy/following{/other_user}","gists_url":"https://api.github.com/users/andrenarchy/gists{/gist_id}","starred_url":"https://api.github.com/users/andrenarchy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrenarchy/subscriptions","organizations_url":"https://api.github.com/users/andrenarchy/orgs","repos_url":"https://api.github.com/users/andrenarchy/repos","events_url":"https://api.github.com/users/andrenarchy/events{/privacy}","received_events_url":"https://api.github.com/users/andrenarchy/received_events","type":"User","site_admin":false},"body":"`ret` is undefined in the case of a failing http request. Then accessing `ret.data.documents` will throw an error.","created_at":"2016-02-15T00:10:27Z","updated_at":"2016-02-15T00:10:27Z","html_url":"https://github.com/paperhive/paperhive-frontend/pull/293#discussion_r52851693","pull_request_url":"https://api.github.com/repos/paperhive/paperhive-frontend/pulls/293","_links":{"self":{"href":"https://api.github.com/repos/paperhive/paperhive-frontend/pulls/comments/52851693"},"html":{"href":"https://github.com/paperhive/paperhive-frontend/pull/293#discussion_r52851693"},"pull_request":{"href":"https://api.github.com/repos/paperhive/paperhive-frontend/pulls/293"}}},"pull_request":{"url":"https://api.github.com/repos/paperhive/paperhive-frontend/pulls/293","id":59308091,"html_url":"https://github.com/paperhive/paperhive-frontend/pull/293","diff_url":"https://github.com/paperhive/paperhive-frontend/pull/293.diff","patch_url":"https://github.com/paperhive/paperhive-frontend/pull/293.patch","issue_url":"https://api.github.com/repos/paperhive/paperhive-frontend/issues/293","number":293,"state":"open","locked":false,"title":"List of starred documents","user":{"login":"nschloe","id":181628,"avatar_url":"https://avatars.githubusercontent.com/u/181628?v=3","gravatar_id":"","url":"https://api.github.com/users/nschloe","html_url":"https://github.com/nschloe","followers_url":"https://api.github.com/users/nschloe/followers","following_url":"https://api.github.com/users/nschloe/following{/other_user}","gists_url":"https://api.github.com/users/nschloe/gists{/gist_id}","starred_url":"https://api.github.com/users/nschloe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nschloe/subscriptions","organizations_url":"https://api.github.com/users/nschloe/orgs","repos_url":"https://api.github.com/users/nschloe/repos","events_url":"https://api.github.com/users/nschloe/events{/privacy}","received_events_url":"https://api.github.com/users/nschloe/received_events","type":"User","site_admin":false},"body":"![starred](https://cloud.githubusercontent.com/assets/181628/13036821/5cb5a598-d372-11e5-966a-3a93e5071375.png)\r\n\r\nTo be merged once the corresponding backend branch has landed.","created_at":"2016-02-14T22:26:44Z","updated_at":"2016-02-15T00:10:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ac03e08fff9ae0f3ac9838c24c9865f01ba13e3a","assignee":{"login":"andrenarchy","id":1874116,"avatar_url":"https://avatars.githubusercontent.com/u/1874116?v=3","gravatar_id":"","url":"https://api.github.com/users/andrenarchy","html_url":"https://github.com/andrenarchy","followers_url":"https://api.github.com/users/andrenarchy/followers","following_url":"https://api.github.com/users/andrenarchy/following{/other_user}","gists_url":"https://api.github.com/users/andrenarchy/gists{/gist_id}","starred_url":"https://api.github.com/users/andrenarchy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrenarchy/subscriptions","organizations_url":"https://api.github.com/users/andrenarchy/orgs","repos_url":"https://api.github.com/users/andrenarchy/repos","events_url":"https://api.github.com/users/andrenarchy/events{/privacy}","received_events_url":"https://api.github.com/users/andrenarchy/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/paperhive/paperhive-frontend/pulls/293/commits","review_comments_url":"https://api.github.com/repos/paperhive/paperhive-frontend/pulls/293/comments","review_comment_url":"https://api.github.com/repos/paperhive/paperhive-frontend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/paperhive/paperhive-frontend/issues/293/comments","statuses_url":"https://api.github.com/repos/paperhive/paperhive-frontend/statuses/61ef3f24fc36cb8b69bea44f68e9e60fabdd1df3","head":{"label":"paperhive:list-of-starred-documents","ref":"list-of-starred-documents","sha":"61ef3f24fc36cb8b69bea44f68e9e60fabdd1df3","user":{"login":"paperhive","id":8027504,"avatar_url":"https://avatars.githubusercontent.com/u/8027504?v=3","gravatar_id":"","url":"https://api.github.com/users/paperhive","html_url":"https://github.com/paperhive","followers_url":"https://api.github.com/users/paperhive/followers","following_url":"https://api.github.com/users/paperhive/following{/other_user}","gists_url":"https://api.github.com/users/paperhive/gists{/gist_id}","starred_url":"https://api.github.com/users/paperhive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paperhive/subscriptions","organizations_url":"https://api.github.com/users/paperhive/orgs","repos_url":"https://api.github.com/users/paperhive/repos","events_url":"https://api.github.com/users/paperhive/events{/privacy}","received_events_url":"https://api.github.com/users/paperhive/received_events","type":"Organization","site_admin":false},"repo":{"id":25691817,"name":"paperhive-frontend","full_name":"paperhive/paperhive-frontend","owner":{"login":"paperhive","id":8027504,"avatar_url":"https://avatars.githubusercontent.com/u/8027504?v=3","gravatar_id":"","url":"https://api.github.com/users/paperhive","html_url":"https://github.com/paperhive","followers_url":"https://api.github.com/users/paperhive/followers","following_url":"https://api.github.com/users/paperhive/following{/other_user}","gists_url":"https://api.github.com/users/paperhive/gists{/gist_id}","starred_url":"https://api.github.com/users/paperhive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paperhive/subscriptions","organizations_url":"https://api.github.com/users/paperhive/orgs","repos_url":"https://api.github.com/users/paperhive/repos","events_url":"https://api.github.com/users/paperhive/events{/privacy}","received_events_url":"https://api.github.com/users/paperhive/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/paperhive/paperhive-frontend","description":"Front end for PaperHive","fork":false,"url":"https://api.github.com/repos/paperhive/paperhive-frontend","forks_url":"https://api.github.com/repos/paperhive/paperhive-frontend/forks","keys_url":"https://api.github.com/repos/paperhive/paperhive-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paperhive/paperhive-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paperhive/paperhive-frontend/teams","hooks_url":"https://api.github.com/repos/paperhive/paperhive-frontend/hooks","issue_events_url":"https://api.github.com/repos/paperhive/paperhive-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/paperhive/paperhive-frontend/events","assignees_url":"https://api.github.com/repos/paperhive/paperhive-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/paperhive/paperhive-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/paperhive/paperhive-frontend/tags","blobs_url":"https://api.github.com/repos/paperhive/paperhive-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paperhive/paperhive-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paperhive/paperhive-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/paperhive/paperhive-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paperhive/paperhive-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/paperhive/paperhive-frontend/languages","stargazers_url":"https://api.github.com/repos/paperhive/paperhive-frontend/stargazers","contributors_url":"https://api.github.com/repos/paperhive/paperhive-frontend/contributors","subscribers_url":"https://api.github.com/repos/paperhive/paperhive-frontend/subscribers","subscription_url":"https://api.github.com/repos/paperhive/paperhive-frontend/subscription","commits_url":"https://api.github.com/repos/paperhive/paperhive-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/paperhive/paperhive-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/paperhive/paperhive-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/paperhive/paperhive-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/paperhive/paperhive-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/paperhive/paperhive-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paperhive/paperhive-frontend/merges","archive_url":"https://api.github.com/repos/paperhive/paperhive-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paperhive/paperhive-frontend/downloads","issues_url":"https://api.github.com/repos/paperhive/paperhive-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/paperhive/paperhive-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/paperhive/paperhive-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/paperhive/paperhive-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paperhive/paperhive-frontend/labels{/name}","releases_url":"https://api.github.com/repos/paperhive/paperhive-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/paperhive/paperhive-frontend/deployments","created_at":"2014-10-24T14:16:38Z","updated_at":"2016-02-06T22:28:05Z","pushed_at":"2016-02-14T23:53:45Z","git_url":"git://github.com/paperhive/paperhive-frontend.git","ssh_url":"git@github.com:paperhive/paperhive-frontend.git","clone_url":"https://github.com/paperhive/paperhive-frontend.git","svn_url":"https://github.com/paperhive/paperhive-frontend","homepage":"https://paperhive.org","size":1499,"stargazers_count":8,"watchers_count":8,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":72,"forks":4,"open_issues":72,"watchers":8,"default_branch":"master"}},"base":{"label":"paperhive:master","ref":"master","sha":"fa833ee0238375fa88c064d78255655270d2ce75","user":{"login":"paperhive","id":8027504,"avatar_url":"https://avatars.githubusercontent.com/u/8027504?v=3","gravatar_id":"","url":"https://api.github.com/users/paperhive","html_url":"https://github.com/paperhive","followers_url":"https://api.github.com/users/paperhive/followers","following_url":"https://api.github.com/users/paperhive/following{/other_user}","gists_url":"https://api.github.com/users/paperhive/gists{/gist_id}","starred_url":"https://api.github.com/users/paperhive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paperhive/subscriptions","organizations_url":"https://api.github.com/users/paperhive/orgs","repos_url":"https://api.github.com/users/paperhive/repos","events_url":"https://api.github.com/users/paperhive/events{/privacy}","received_events_url":"https://api.github.com/users/paperhive/received_events","type":"Organization","site_admin":false},"repo":{"id":25691817,"name":"paperhive-frontend","full_name":"paperhive/paperhive-frontend","owner":{"login":"paperhive","id":8027504,"avatar_url":"https://avatars.githubusercontent.com/u/8027504?v=3","gravatar_id":"","url":"https://api.github.com/users/paperhive","html_url":"https://github.com/paperhive","followers_url":"https://api.github.com/users/paperhive/followers","following_url":"https://api.github.com/users/paperhive/following{/other_user}","gists_url":"https://api.github.com/users/paperhive/gists{/gist_id}","starred_url":"https://api.github.com/users/paperhive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paperhive/subscriptions","organizations_url":"https://api.github.com/users/paperhive/orgs","repos_url":"https://api.github.com/users/paperhive/repos","events_url":"https://api.github.com/users/paperhive/events{/privacy}","received_events_url":"https://api.github.com/users/paperhive/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/paperhive/paperhive-frontend","description":"Front end for PaperHive","fork":false,"url":"https://api.github.com/repos/paperhive/paperhive-frontend","forks_url":"https://api.github.com/repos/paperhive/paperhive-frontend/forks","keys_url":"https://api.github.com/repos/paperhive/paperhive-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paperhive/paperhive-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paperhive/paperhive-frontend/teams","hooks_url":"https://api.github.com/repos/paperhive/paperhive-frontend/hooks","issue_events_url":"https://api.github.com/repos/paperhive/paperhive-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/paperhive/paperhive-frontend/events","assignees_url":"https://api.github.com/repos/paperhive/paperhive-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/paperhive/paperhive-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/paperhive/paperhive-frontend/tags","blobs_url":"https://api.github.com/repos/paperhive/paperhive-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paperhive/paperhive-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paperhive/paperhive-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/paperhive/paperhive-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paperhive/paperhive-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/paperhive/paperhive-frontend/languages","stargazers_url":"https://api.github.com/repos/paperhive/paperhive-frontend/stargazers","contributors_url":"https://api.github.com/repos/paperhive/paperhive-frontend/contributors","subscribers_url":"https://api.github.com/repos/paperhive/paperhive-frontend/subscribers","subscription_url":"https://api.github.com/repos/paperhive/paperhive-frontend/subscription","commits_url":"https://api.github.com/repos/paperhive/paperhive-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/paperhive/paperhive-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/paperhive/paperhive-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/paperhive/paperhive-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/paperhive/paperhive-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/paperhive/paperhive-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paperhive/paperhive-frontend/merges","archive_url":"https://api.github.com/repos/paperhive/paperhive-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paperhive/paperhive-frontend/downloads","issues_url":"https://api.github.com/repos/paperhive/paperhive-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/paperhive/paperhive-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/paperhive/paperhive-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/paperhive/paperhive-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paperhive/paperhive-frontend/labels{/name}","releases_url":"https://api.github.com/repos/paperhive/paperhive-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/paperhive/paperhive-frontend/deployments","created_at":"2014-10-24T14:16:38Z","updated_at":"2016-02-06T22:28:05Z","pushed_at":"2016-02-14T23:53:45Z","git_url":"git://github.com/paperhive/paperhive-frontend.git","ssh_url":"git@github.com:paperhive/paperhive-frontend.git","clone_url":"https://github.com/paperhive/paperhive-frontend.git","svn_url":"https://github.com/paperhive/paperhive-frontend","homepage":"https://paperhive.org","size":1499,"stargazers_count":8,"watchers_count":8,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":72,"forks":4,"open_issues":72,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/paperhive/paperhive-frontend/pulls/293"},"html":{"href":"https://github.com/paperhive/paperhive-frontend/pull/293"},"issue":{"href":"https://api.github.com/repos/paperhive/paperhive-frontend/issues/293"},"comments":{"href":"https://api.github.com/repos/paperhive/paperhive-frontend/issues/293/comments"},"review_comments":{"href":"https://api.github.com/repos/paperhive/paperhive-frontend/pulls/293/comments"},"review_comment":{"href":"https://api.github.com/repos/paperhive/paperhive-frontend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/paperhive/paperhive-frontend/pulls/293/commits"},"statuses":{"href":"https://api.github.com/repos/paperhive/paperhive-frontend/statuses/61ef3f24fc36cb8b69bea44f68e9e60fabdd1df3"}}}}