{"action":"created","comment":{"url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/pulls/comments/48350408","id":48350408,"diff_hunk":"@@ -19,18 +33,43 @@ var SeatSelector = React.createClass({\n     }\n \n     // different price groups among seats in this show; prices[0] is the most expensive one\n-    var getBasePrice = function(seat) {\n-      return seat.prices[0].price;\n+    var getBasePrice = function(section) {\n+      return section.discount_groups[0].price;\n     };\n-    var prices = _.uniq(this.props.seats.map(getBasePrice)).sort().reverse();\n+    var prices = _.uniq(_.values(this.props.show.get('sections')).map(getBasePrice)).sort().reverse();","path":"frontend/src/js/components/SeatSelector.jsx","position":34,"original_position":34,"commit_id":"363d281e69e65ebfabe9ea3628d9f8e8967b2095","original_commit_id":"363d281e69e65ebfabe9ea3628d9f8e8967b2095","user":{"login":"pekko","id":1670576,"avatar_url":"https://avatars.githubusercontent.com/u/1670576?v=3","gravatar_id":"","url":"https://api.github.com/users/pekko","html_url":"https://github.com/pekko","followers_url":"https://api.github.com/users/pekko/followers","following_url":"https://api.github.com/users/pekko/following{/other_user}","gists_url":"https://api.github.com/users/pekko/gists{/gist_id}","starred_url":"https://api.github.com/users/pekko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pekko/subscriptions","organizations_url":"https://api.github.com/users/pekko/orgs","repos_url":"https://api.github.com/users/pekko/repos","events_url":"https://api.github.com/users/pekko/events{/privacy}","received_events_url":"https://api.github.com/users/pekko/received_events","type":"User","site_admin":false},"body":"We might want to start using `_.chain` here, I wonder if it makes it cleaner:\r\n\r\n```\r\n_.chain(this.props.show.get('sections')\r\n.map(getBasePrice)\r\n.values()\r\n.uniq()\r\n.value()\r\n.sort()\r\n.reverse()\r\n```","created_at":"2015-12-23T14:53:43Z","updated_at":"2015-12-23T14:53:43Z","html_url":"https://github.com/teekkarispeksi/nappikauppa2/pull/42#discussion_r48350408","pull_request_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/pulls/42","_links":{"self":{"href":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/pulls/comments/48350408"},"html":{"href":"https://github.com/teekkarispeksi/nappikauppa2/pull/42#discussion_r48350408"},"pull_request":{"href":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/pulls/42"}}},"pull_request":{"url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/pulls/42","id":54407836,"html_url":"https://github.com/teekkarispeksi/nappikauppa2/pull/42","diff_url":"https://github.com/teekkarispeksi/nappikauppa2/pull/42.diff","patch_url":"https://github.com/teekkarispeksi/nappikauppa2/pull/42.patch","issue_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/issues/42","number":42,"state":"open","locked":false,"title":"Refactor this.seats","user":{"login":"Blizzara","id":1384385,"avatar_url":"https://avatars.githubusercontent.com/u/1384385?v=3","gravatar_id":"","url":"https://api.github.com/users/Blizzara","html_url":"https://github.com/Blizzara","followers_url":"https://api.github.com/users/Blizzara/followers","following_url":"https://api.github.com/users/Blizzara/following{/other_user}","gists_url":"https://api.github.com/users/Blizzara/gists{/gist_id}","starred_url":"https://api.github.com/users/Blizzara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Blizzara/subscriptions","organizations_url":"https://api.github.com/users/Blizzara/orgs","repos_url":"https://api.github.com/users/Blizzara/repos","events_url":"https://api.github.com/users/Blizzara/events{/privacy}","received_events_url":"https://api.github.com/users/Blizzara/received_events","type":"User","site_admin":false},"body":"- changes a bit the way backend handles and sends the seat information\r\n- use the static venue seat info and show section info in frontend without copying those into another object\r\n- the net effect is -7 lines, but I think this is simpler and less prone to errors \r\n- also should be easier to do unnumbered seats now","created_at":"2015-12-22T19:50:26Z","updated_at":"2015-12-23T14:53:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"af91617ec43e29e3c994e35fe2222d26ec677f70","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/pulls/42/commits","review_comments_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/pulls/42/comments","review_comment_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/issues/42/comments","statuses_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/statuses/363d281e69e65ebfabe9ea3628d9f8e8967b2095","head":{"label":"teekkarispeksi:refactor-this.seats","ref":"refactor-this.seats","sha":"363d281e69e65ebfabe9ea3628d9f8e8967b2095","user":{"login":"teekkarispeksi","id":3393770,"avatar_url":"https://avatars.githubusercontent.com/u/3393770?v=3","gravatar_id":"","url":"https://api.github.com/users/teekkarispeksi","html_url":"https://github.com/teekkarispeksi","followers_url":"https://api.github.com/users/teekkarispeksi/followers","following_url":"https://api.github.com/users/teekkarispeksi/following{/other_user}","gists_url":"https://api.github.com/users/teekkarispeksi/gists{/gist_id}","starred_url":"https://api.github.com/users/teekkarispeksi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teekkarispeksi/subscriptions","organizations_url":"https://api.github.com/users/teekkarispeksi/orgs","repos_url":"https://api.github.com/users/teekkarispeksi/repos","events_url":"https://api.github.com/users/teekkarispeksi/events{/privacy}","received_events_url":"https://api.github.com/users/teekkarispeksi/received_events","type":"User","site_admin":false},"repo":{"id":39674726,"name":"nappikauppa2","full_name":"teekkarispeksi/nappikauppa2","owner":{"login":"teekkarispeksi","id":3393770,"avatar_url":"https://avatars.githubusercontent.com/u/3393770?v=3","gravatar_id":"","url":"https://api.github.com/users/teekkarispeksi","html_url":"https://github.com/teekkarispeksi","followers_url":"https://api.github.com/users/teekkarispeksi/followers","following_url":"https://api.github.com/users/teekkarispeksi/following{/other_user}","gists_url":"https://api.github.com/users/teekkarispeksi/gists{/gist_id}","starred_url":"https://api.github.com/users/teekkarispeksi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teekkarispeksi/subscriptions","organizations_url":"https://api.github.com/users/teekkarispeksi/orgs","repos_url":"https://api.github.com/users/teekkarispeksi/repos","events_url":"https://api.github.com/users/teekkarispeksi/events{/privacy}","received_events_url":"https://api.github.com/users/teekkarispeksi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/teekkarispeksi/nappikauppa2","description":"","fork":false,"url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2","forks_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/forks","keys_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/teams","hooks_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/hooks","issue_events_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/issues/events{/number}","events_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/events","assignees_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/assignees{/user}","branches_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/branches{/branch}","tags_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/tags","blobs_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/git/refs{/sha}","trees_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/statuses/{sha}","languages_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/languages","stargazers_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/stargazers","contributors_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/contributors","subscribers_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/subscribers","subscription_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/subscription","commits_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/commits{/sha}","git_commits_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/git/commits{/sha}","comments_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/comments{/number}","issue_comment_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/issues/comments{/number}","contents_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/contents/{+path}","compare_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/merges","archive_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/downloads","issues_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/issues{/number}","pulls_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/pulls{/number}","milestones_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/milestones{/number}","notifications_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/labels{/name}","releases_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/releases{/id}","created_at":"2015-07-25T06:15:12Z","updated_at":"2015-08-22T18:14:42Z","pushed_at":"2015-12-22T21:25:54Z","git_url":"git://github.com/teekkarispeksi/nappikauppa2.git","ssh_url":"git@github.com:teekkarispeksi/nappikauppa2.git","clone_url":"https://github.com/teekkarispeksi/nappikauppa2.git","svn_url":"https://github.com/teekkarispeksi/nappikauppa2","homepage":null,"size":648,"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":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"teekkarispeksi:master","ref":"master","sha":"306866fbb72acc7780cbe4ce70f164b0f84f6d39","user":{"login":"teekkarispeksi","id":3393770,"avatar_url":"https://avatars.githubusercontent.com/u/3393770?v=3","gravatar_id":"","url":"https://api.github.com/users/teekkarispeksi","html_url":"https://github.com/teekkarispeksi","followers_url":"https://api.github.com/users/teekkarispeksi/followers","following_url":"https://api.github.com/users/teekkarispeksi/following{/other_user}","gists_url":"https://api.github.com/users/teekkarispeksi/gists{/gist_id}","starred_url":"https://api.github.com/users/teekkarispeksi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teekkarispeksi/subscriptions","organizations_url":"https://api.github.com/users/teekkarispeksi/orgs","repos_url":"https://api.github.com/users/teekkarispeksi/repos","events_url":"https://api.github.com/users/teekkarispeksi/events{/privacy}","received_events_url":"https://api.github.com/users/teekkarispeksi/received_events","type":"User","site_admin":false},"repo":{"id":39674726,"name":"nappikauppa2","full_name":"teekkarispeksi/nappikauppa2","owner":{"login":"teekkarispeksi","id":3393770,"avatar_url":"https://avatars.githubusercontent.com/u/3393770?v=3","gravatar_id":"","url":"https://api.github.com/users/teekkarispeksi","html_url":"https://github.com/teekkarispeksi","followers_url":"https://api.github.com/users/teekkarispeksi/followers","following_url":"https://api.github.com/users/teekkarispeksi/following{/other_user}","gists_url":"https://api.github.com/users/teekkarispeksi/gists{/gist_id}","starred_url":"https://api.github.com/users/teekkarispeksi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teekkarispeksi/subscriptions","organizations_url":"https://api.github.com/users/teekkarispeksi/orgs","repos_url":"https://api.github.com/users/teekkarispeksi/repos","events_url":"https://api.github.com/users/teekkarispeksi/events{/privacy}","received_events_url":"https://api.github.com/users/teekkarispeksi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/teekkarispeksi/nappikauppa2","description":"","fork":false,"url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2","forks_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/forks","keys_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/teams","hooks_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/hooks","issue_events_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/issues/events{/number}","events_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/events","assignees_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/assignees{/user}","branches_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/branches{/branch}","tags_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/tags","blobs_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/git/refs{/sha}","trees_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/statuses/{sha}","languages_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/languages","stargazers_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/stargazers","contributors_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/contributors","subscribers_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/subscribers","subscription_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/subscription","commits_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/commits{/sha}","git_commits_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/git/commits{/sha}","comments_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/comments{/number}","issue_comment_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/issues/comments{/number}","contents_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/contents/{+path}","compare_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/merges","archive_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/downloads","issues_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/issues{/number}","pulls_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/pulls{/number}","milestones_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/milestones{/number}","notifications_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/labels{/name}","releases_url":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/releases{/id}","created_at":"2015-07-25T06:15:12Z","updated_at":"2015-08-22T18:14:42Z","pushed_at":"2015-12-22T21:25:54Z","git_url":"git://github.com/teekkarispeksi/nappikauppa2.git","ssh_url":"git@github.com:teekkarispeksi/nappikauppa2.git","clone_url":"https://github.com/teekkarispeksi/nappikauppa2.git","svn_url":"https://github.com/teekkarispeksi/nappikauppa2","homepage":null,"size":648,"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":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/pulls/42"},"html":{"href":"https://github.com/teekkarispeksi/nappikauppa2/pull/42"},"issue":{"href":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/issues/42"},"comments":{"href":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/issues/42/comments"},"review_comments":{"href":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/pulls/42/comments"},"review_comment":{"href":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/pulls/42/commits"},"statuses":{"href":"https://api.github.com/repos/teekkarispeksi/nappikauppa2/statuses/363d281e69e65ebfabe9ea3628d9f8e8967b2095"}}}}