GitHub PullRequestReviewCommentEvent at 2014-09-16 21:13:56
Repository: li-widgets
Actor: johnywith1n
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/lithiumtech/li-widgets/pulls/comments/17630949","id":17630949,"diff_hunk":"@@ -87,45 +87,97 @@ module.exports = {\n       }\n     }\n \n+    function populateHelpfulness (items) {\n+      for (var j in items) {\n+          if (items[j]) {\n+            var helpfulnessData;\n+            helpfulnessData = { helpful: items[j].helpful };\n+            updateAffinity(items[j].userId, items[j].reviewId, 'review', 'helpfulness', \n+              helpfulnessData, items[j].companyGuid);\n+          }\n+        }\n+    }\n+\n+    function populateEndorsements(items) {\n+     for (var k in items) {\n+          if (items[k]) {\n+            var endorsementData;\n+            endorsementData = { reasons: [items[k].reason] };\n+             updateAffinity(items[k].userId, items[k].productId, 'product', 'endorsement', \n+                  endorsementData, items[k].companyGuid);\n+        }\n+      }\n+    }\n+\n+   function updateAffinity(userId, targetId, targetType, relation, data, companyGuid) {\n+      var affinityId = companyGuid + userId + targetId+ relation;\n+      AffinityService.delete(companyGuid, affinityId).then(function () {\n+        AffinityService.postFor(userId, targetId, targetType, relation, \n+          data, companyGuid);\n+      }).catch(function () {","path":"api/controllers/MainController.js","position":40,"original_position":40,"commit_id":"a7bd680b2d35ba43412c20f68c18786c80058a67","original_commit_id":"a7bd680b2d35ba43412c20f68c18786c80058a67","user":{"login":"johnywith1n","id":321466,"avatar_url":"https://avatars.githubusercontent.com/u/321466?v=2","gravatar_id":"a1c25e5f91dd3ec51ac4bf0478ea3e71","url":"https://api.github.com/users/johnywith1n","html_url":"https://github.com/johnywith1n","followers_url":"https://api.github.com/users/johnywith1n/followers","following_url":"https://api.github.com/users/johnywith1n/following{/other_user}","gists_url":"https://api.github.com/users/johnywith1n/gists{/gist_id}","starred_url":"https://api.github.com/users/johnywith1n/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnywith1n/subscriptions","organizations_url":"https://api.github.com/users/johnywith1n/orgs","repos_url":"https://api.github.com/users/johnywith1n/repos","events_url":"https://api.github.com/users/johnywith1n/events{/privacy}","received_events_url":"https://api.github.com/users/johnywith1n/received_events","type":"User","site_admin":false},"body":"I'm not sure this will work because the catch method is called on the promise returned from the then call, which is a different promise than the one returned from the delete call.\r\n\r\ntry \r\n\r\n```\r\nvar postHandler = function () {\r\nreturn AffinityService.postFor(userId, targetId, targetType, relation,\r\n\t+ data, companyGuid);\r\n}\r\n\r\nAffinityService.delete(companyGuid, affinityId).then(postHandler, postHandler).done();\r\n\r\n```","created_at":"2014-09-16T21:13:56Z","updated_at":"2014-09-16T21:13:56Z","html_url":"https://github.com/lithiumtech/li-widgets/pull/175#discussion_r17630949","pull_request_url":"https://api.github.com/repos/lithiumtech/li-widgets/pulls/175","_links":{"self":{"href":"https://api.github.com/repos/lithiumtech/li-widgets/pulls/comments/17630949"},"html":{"href":"https://github.com/lithiumtech/li-widgets/pull/175#discussion_r17630949"},"pull_request":{"href":"https://api.github.com/repos/lithiumtech/li-widgets/pulls/175"}}},"pull_request":{"url":"https://api.github.com/repos/lithiumtech/li-widgets/pulls/175","id":21057895,"html_url":"https://github.com/lithiumtech/li-widgets/pull/175","diff_url":"https://github.com/lithiumtech/li-widgets/pull/175.diff","patch_url":"https://github.com/lithiumtech/li-widgets/pull/175.patch","issue_url":"https://api.github.com/repos/lithiumtech/li-widgets/issues/175","number":175,"state":"open","locked":false,"title":"feat(test_builder): add ability to create endorsements and helpfulness v...","user":{"login":"subbu171","id":4564443,"avatar_url":"https://avatars.githubusercontent.com/u/4564443?v=2","gravatar_id":"a6bc71383b1fe5b7d82a3abf1fe92a51","url":"https://api.github.com/users/subbu171","html_url":"https://github.com/subbu171","followers_url":"https://api.github.com/users/subbu171/followers","following_url":"https://api.github.com/users/subbu171/following{/other_user}","gists_url":"https://api.github.com/users/subbu171/gists{/gist_id}","starred_url":"https://api.github.com/users/subbu171/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/subbu171/subscriptions","organizations_url":"https://api.github.com/users/subbu171/orgs","repos_url":"https://api.github.com/users/subbu171/repos","events_url":"https://api.github.com/users/subbu171/events{/privacy}","received_events_url":"https://api.github.com/users/subbu171/received_events","type":"User","site_admin":false},"body":"...ia testbuilder","created_at":"2014-09-10T23:31:56Z","updated_at":"2014-09-16T21:13:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5492dfa6e46410d283e191771159280ab0879d29","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/lithiumtech/li-widgets/pulls/175/commits","review_comments_url":"https://api.github.com/repos/lithiumtech/li-widgets/pulls/175/comments","review_comment_url":"https://api.github.com/repos/lithiumtech/li-widgets/pulls/comments/{number}","comments_url":"https://api.github.com/repos/lithiumtech/li-widgets/issues/175/comments","statuses_url":"https://api.github.com/repos/lithiumtech/li-widgets/statuses/a7bd680b2d35ba43412c20f68c18786c80058a67","head":{"label":"lithiumtech:feature/NOW-399","ref":"feature/NOW-399","sha":"a7bd680b2d35ba43412c20f68c18786c80058a67","user":{"login":"lithiumtech","id":4430799,"avatar_url":"https://avatars.githubusercontent.com/u/4430799?v=2","gravatar_id":"124d0af471085117db72e4d21aa7a5ca","url":"https://api.github.com/users/lithiumtech","html_url":"https://github.com/lithiumtech","followers_url":"https://api.github.com/users/lithiumtech/followers","following_url":"https://api.github.com/users/lithiumtech/following{/other_user}","gists_url":"https://api.github.com/users/lithiumtech/gists{/gist_id}","starred_url":"https://api.github.com/users/lithiumtech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lithiumtech/subscriptions","organizations_url":"https://api.github.com/users/lithiumtech/orgs","repos_url":"https://api.github.com/users/lithiumtech/repos","events_url":"https://api.github.com/users/lithiumtech/events{/privacy}","received_events_url":"https://api.github.com/users/lithiumtech/received_events","type":"Organization","site_admin":false},"repo":{"id":17885634,"name":"li-widgets","full_name":"lithiumtech/li-widgets","owner":{"login":"lithiumtech","id":4430799,"avatar_url":"https://avatars.githubusercontent.com/u/4430799?v=2","gravatar_id":"124d0af471085117db72e4d21aa7a5ca","url":"https://api.github.com/users/lithiumtech","html_url":"https://github.com/lithiumtech","followers_url":"https://api.github.com/users/lithiumtech/followers","following_url":"https://api.github.com/users/lithiumtech/following{/other_user}","gists_url":"https://api.github.com/users/lithiumtech/gists{/gist_id}","starred_url":"https://api.github.com/users/lithiumtech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lithiumtech/subscriptions","organizations_url":"https://api.github.com/users/lithiumtech/orgs","repos_url":"https://api.github.com/users/lithiumtech/repos","events_url":"https://api.github.com/users/lithiumtech/events{/privacy}","received_events_url":"https://api.github.com/users/lithiumtech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lithiumtech/li-widgets","description":"Distributed Community Widgets","fork":false,"url":"https://api.github.com/repos/lithiumtech/li-widgets","forks_url":"https://api.github.com/repos/lithiumtech/li-widgets/forks","keys_url":"https://api.github.com/repos/lithiumtech/li-widgets/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lithiumtech/li-widgets/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lithiumtech/li-widgets/teams","hooks_url":"https://api.github.com/repos/lithiumtech/li-widgets/hooks","issue_events_url":"https://api.github.com/repos/lithiumtech/li-widgets/issues/events{/number}","events_url":"https://api.github.com/repos/lithiumtech/li-widgets/events","assignees_url":"https://api.github.com/repos/lithiumtech/li-widgets/assignees{/user}","branches_url":"https://api.github.com/repos/lithiumtech/li-widgets/branches{/branch}","tags_url":"https://api.github.com/repos/lithiumtech/li-widgets/tags","blobs_url":"https://api.github.com/repos/lithiumtech/li-widgets/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lithiumtech/li-widgets/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lithiumtech/li-widgets/git/refs{/sha}","trees_url":"https://api.github.com/repos/lithiumtech/li-widgets/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lithiumtech/li-widgets/statuses/{sha}","languages_url":"https://api.github.com/repos/lithiumtech/li-widgets/languages","stargazers_url":"https://api.github.com/repos/lithiumtech/li-widgets/stargazers","contributors_url":"https://api.github.com/repos/lithiumtech/li-widgets/contributors","subscribers_url":"https://api.github.com/repos/lithiumtech/li-widgets/subscribers","subscription_url":"https://api.github.com/repos/lithiumtech/li-widgets/subscription","commits_url":"https://api.github.com/repos/lithiumtech/li-widgets/commits{/sha}","git_commits_url":"https://api.github.com/repos/lithiumtech/li-widgets/git/commits{/sha}","comments_url":"https://api.github.com/repos/lithiumtech/li-widgets/comments{/number}","issue_comment_url":"https://api.github.com/repos/lithiumtech/li-widgets/issues/comments/{number}","contents_url":"https://api.github.com/repos/lithiumtech/li-widgets/contents/{+path}","compare_url":"https://api.github.com/repos/lithiumtech/li-widgets/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lithiumtech/li-widgets/merges","archive_url":"https://api.github.com/repos/lithiumtech/li-widgets/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lithiumtech/li-widgets/downloads","issues_url":"https://api.github.com/repos/lithiumtech/li-widgets/issues{/number}","pulls_url":"https://api.github.com/repos/lithiumtech/li-widgets/pulls{/number}","milestones_url":"https://api.github.com/repos/lithiumtech/li-widgets/milestones{/number}","notifications_url":"https://api.github.com/repos/lithiumtech/li-widgets/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lithiumtech/li-widgets/labels{/name}","releases_url":"https://api.github.com/repos/lithiumtech/li-widgets/releases{/id}","created_at":"2014-03-18T23:29:23Z","updated_at":"2014-09-03T16:59:11Z","pushed_at":"2014-09-16T21:08:40Z","git_url":"git://github.com/lithiumtech/li-widgets.git","ssh_url":"git@github.com:lithiumtech/li-widgets.git","clone_url":"https://github.com/lithiumtech/li-widgets.git","svn_url":"https://github.com/lithiumtech/li-widgets","homepage":"http://distributed.lithium.com","size":185880,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":1,"default_branch":"develop"}},"base":{"label":"lithiumtech:develop","ref":"develop","sha":"649be7d6ad51220d73505145277e5ff8cd54aae0","user":{"login":"lithiumtech","id":4430799,"avatar_url":"https://avatars.githubusercontent.com/u/4430799?v=2","gravatar_id":"124d0af471085117db72e4d21aa7a5ca","url":"https://api.github.com/users/lithiumtech","html_url":"https://github.com/lithiumtech","followers_url":"https://api.github.com/users/lithiumtech/followers","following_url":"https://api.github.com/users/lithiumtech/following{/other_user}","gists_url":"https://api.github.com/users/lithiumtech/gists{/gist_id}","starred_url":"https://api.github.com/users/lithiumtech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lithiumtech/subscriptions","organizations_url":"https://api.github.com/users/lithiumtech/orgs","repos_url":"https://api.github.com/users/lithiumtech/repos","events_url":"https://api.github.com/users/lithiumtech/events{/privacy}","received_events_url":"https://api.github.com/users/lithiumtech/received_events","type":"Organization","site_admin":false},"repo":{"id":17885634,"name":"li-widgets","full_name":"lithiumtech/li-widgets","owner":{"login":"lithiumtech","id":4430799,"avatar_url":"https://avatars.githubusercontent.com/u/4430799?v=2","gravatar_id":"124d0af471085117db72e4d21aa7a5ca","url":"https://api.github.com/users/lithiumtech","html_url":"https://github.com/lithiumtech","followers_url":"https://api.github.com/users/lithiumtech/followers","following_url":"https://api.github.com/users/lithiumtech/following{/other_user}","gists_url":"https://api.github.com/users/lithiumtech/gists{/gist_id}","starred_url":"https://api.github.com/users/lithiumtech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lithiumtech/subscriptions","organizations_url":"https://api.github.com/users/lithiumtech/orgs","repos_url":"https://api.github.com/users/lithiumtech/repos","events_url":"https://api.github.com/users/lithiumtech/events{/privacy}","received_events_url":"https://api.github.com/users/lithiumtech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lithiumtech/li-widgets","description":"Distributed Community Widgets","fork":false,"url":"https://api.github.com/repos/lithiumtech/li-widgets","forks_url":"https://api.github.com/repos/lithiumtech/li-widgets/forks","keys_url":"https://api.github.com/repos/lithiumtech/li-widgets/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lithiumtech/li-widgets/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lithiumtech/li-widgets/teams","hooks_url":"https://api.github.com/repos/lithiumtech/li-widgets/hooks","issue_events_url":"https://api.github.com/repos/lithiumtech/li-widgets/issues/events{/number}","events_url":"https://api.github.com/repos/lithiumtech/li-widgets/events","assignees_url":"https://api.github.com/repos/lithiumtech/li-widgets/assignees{/user}","branches_url":"https://api.github.com/repos/lithiumtech/li-widgets/branches{/branch}","tags_url":"https://api.github.com/repos/lithiumtech/li-widgets/tags","blobs_url":"https://api.github.com/repos/lithiumtech/li-widgets/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lithiumtech/li-widgets/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lithiumtech/li-widgets/git/refs{/sha}","trees_url":"https://api.github.com/repos/lithiumtech/li-widgets/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lithiumtech/li-widgets/statuses/{sha}","languages_url":"https://api.github.com/repos/lithiumtech/li-widgets/languages","stargazers_url":"https://api.github.com/repos/lithiumtech/li-widgets/stargazers","contributors_url":"https://api.github.com/repos/lithiumtech/li-widgets/contributors","subscribers_url":"https://api.github.com/repos/lithiumtech/li-widgets/subscribers","subscription_url":"https://api.github.com/repos/lithiumtech/li-widgets/subscription","commits_url":"https://api.github.com/repos/lithiumtech/li-widgets/commits{/sha}","git_commits_url":"https://api.github.com/repos/lithiumtech/li-widgets/git/commits{/sha}","comments_url":"https://api.github.com/repos/lithiumtech/li-widgets/comments{/number}","issue_comment_url":"https://api.github.com/repos/lithiumtech/li-widgets/issues/comments/{number}","contents_url":"https://api.github.com/repos/lithiumtech/li-widgets/contents/{+path}","compare_url":"https://api.github.com/repos/lithiumtech/li-widgets/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lithiumtech/li-widgets/merges","archive_url":"https://api.github.com/repos/lithiumtech/li-widgets/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lithiumtech/li-widgets/downloads","issues_url":"https://api.github.com/repos/lithiumtech/li-widgets/issues{/number}","pulls_url":"https://api.github.com/repos/lithiumtech/li-widgets/pulls{/number}","milestones_url":"https://api.github.com/repos/lithiumtech/li-widgets/milestones{/number}","notifications_url":"https://api.github.com/repos/lithiumtech/li-widgets/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lithiumtech/li-widgets/labels{/name}","releases_url":"https://api.github.com/repos/lithiumtech/li-widgets/releases{/id}","created_at":"2014-03-18T23:29:23Z","updated_at":"2014-09-03T16:59:11Z","pushed_at":"2014-09-16T21:08:40Z","git_url":"git://github.com/lithiumtech/li-widgets.git","ssh_url":"git@github.com:lithiumtech/li-widgets.git","clone_url":"https://github.com/lithiumtech/li-widgets.git","svn_url":"https://github.com/lithiumtech/li-widgets","homepage":"http://distributed.lithium.com","size":185880,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/lithiumtech/li-widgets/pulls/175"},"html":{"href":"https://github.com/lithiumtech/li-widgets/pull/175"},"issue":{"href":"https://api.github.com/repos/lithiumtech/li-widgets/issues/175"},"comments":{"href":"https://api.github.com/repos/lithiumtech/li-widgets/issues/175/comments"},"review_comments":{"href":"https://api.github.com/repos/lithiumtech/li-widgets/pulls/175/comments"},"review_comment":{"href":"https://api.github.com/repos/lithiumtech/li-widgets/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/lithiumtech/li-widgets/pulls/175/commits"},"statuses":{"href":"https://api.github.com/repos/lithiumtech/li-widgets/statuses/a7bd680b2d35ba43412c20f68c18786c80058a67"}}}}