{"action":"created","comment":{"url":"https://api.github.com/repos/code-corps/code-corps-phoenix/pulls/comments/76155436","id":76155436,"diff_hunk":"@@ -19,6 +19,17 @@ defmodule CodeCorps.OrganizationMembershipController do\n     render(conn, \"index.json-api\", data: memberships)\n   end\n \n+  def index(conn, %{\"role\" => roles}) do\n+    roles = roles |> coalesce_string\n+    memberships =\n+      OrganizationMembership\n+      |> preload([:organization, :member])\n+      |> where([p], p.role in ^roles)\n+      |> Repo.all\n+\n+    render(conn, \"index.json-api\", data: memberships)\n+  end","path":"web/controllers/organization_membership_controller.ex","position":13,"original_position":13,"commit_id":"7f956893272a66ade0311fca03665fddc28f1d92","original_commit_id":"7f956893272a66ade0311fca03665fddc28f1d92","user":{"login":"JoshSmith","id":321667,"avatar_url":"https://avatars.githubusercontent.com/u/321667?v=3","gravatar_id":"","url":"https://api.github.com/users/JoshSmith","html_url":"https://github.com/JoshSmith","followers_url":"https://api.github.com/users/JoshSmith/followers","following_url":"https://api.github.com/users/JoshSmith/following{/other_user}","gists_url":"https://api.github.com/users/JoshSmith/gists{/gist_id}","starred_url":"https://api.github.com/users/JoshSmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoshSmith/subscriptions","organizations_url":"https://api.github.com/users/JoshSmith/orgs","repos_url":"https://api.github.com/users/JoshSmith/repos","events_url":"https://api.github.com/users/JoshSmith/events{/privacy}","received_events_url":"https://api.github.com/users/JoshSmith/received_events","type":"User","site_admin":false},"body":"It looks like the problem with this approach is that the two could be combined: you may be filtering either `ids` or `roles`.\r\n\r\nI'm not sure what the actual requests look like that are generating the filtering, and if they're both used, but this does look like a bit of an explosion of endpoints and some duplication, as well as possibly missing combinations of request types.","created_at":"2016-08-24T23:02:14Z","updated_at":"2016-08-24T23:02:14Z","html_url":"https://github.com/code-corps/code-corps-phoenix/pull/139#discussion_r76155436","pull_request_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/pulls/139","_links":{"self":{"href":"https://api.github.com/repos/code-corps/code-corps-phoenix/pulls/comments/76155436"},"html":{"href":"https://github.com/code-corps/code-corps-phoenix/pull/139#discussion_r76155436"},"pull_request":{"href":"https://api.github.com/repos/code-corps/code-corps-phoenix/pulls/139"}}},"pull_request":{"url":"https://api.github.com/repos/code-corps/code-corps-phoenix/pulls/139","id":82628344,"html_url":"https://github.com/code-corps/code-corps-phoenix/pull/139","diff_url":"https://github.com/code-corps/code-corps-phoenix/pull/139.diff","patch_url":"https://github.com/code-corps/code-corps-phoenix/pull/139.patch","issue_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/issues/139","number":139,"state":"open","locked":false,"title":"Add role search to organization memberships","user":{"login":"npendery","id":12616684,"avatar_url":"https://avatars.githubusercontent.com/u/12616684?v=3","gravatar_id":"","url":"https://api.github.com/users/npendery","html_url":"https://github.com/npendery","followers_url":"https://api.github.com/users/npendery/followers","following_url":"https://api.github.com/users/npendery/following{/other_user}","gists_url":"https://api.github.com/users/npendery/gists{/gist_id}","starred_url":"https://api.github.com/users/npendery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npendery/subscriptions","organizations_url":"https://api.github.com/users/npendery/orgs","repos_url":"https://api.github.com/users/npendery/repos","events_url":"https://api.github.com/users/npendery/events{/privacy}","received_events_url":"https://api.github.com/users/npendery/received_events","type":"User","site_admin":false},"body":"Closes #132 ","created_at":"2016-08-24T22:26:18Z","updated_at":"2016-08-24T23:02:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b7f6cde2d9e0340d52cb8025e491a1987cceed4c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/pulls/139/commits","review_comments_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/pulls/139/comments","review_comment_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/pulls/comments{/number}","comments_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/issues/139/comments","statuses_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/statuses/7f956893272a66ade0311fca03665fddc28f1d92","head":{"label":"code-corps:np-filter-by-role","ref":"np-filter-by-role","sha":"7f956893272a66ade0311fca03665fddc28f1d92","user":{"login":"code-corps","id":12991115,"avatar_url":"https://avatars.githubusercontent.com/u/12991115?v=3","gravatar_id":"","url":"https://api.github.com/users/code-corps","html_url":"https://github.com/code-corps","followers_url":"https://api.github.com/users/code-corps/followers","following_url":"https://api.github.com/users/code-corps/following{/other_user}","gists_url":"https://api.github.com/users/code-corps/gists{/gist_id}","starred_url":"https://api.github.com/users/code-corps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-corps/subscriptions","organizations_url":"https://api.github.com/users/code-corps/orgs","repos_url":"https://api.github.com/users/code-corps/repos","events_url":"https://api.github.com/users/code-corps/events{/privacy}","received_events_url":"https://api.github.com/users/code-corps/received_events","type":"Organization","site_admin":false},"repo":{"id":63497734,"name":"code-corps-phoenix","full_name":"code-corps/code-corps-phoenix","owner":{"login":"code-corps","id":12991115,"avatar_url":"https://avatars.githubusercontent.com/u/12991115?v=3","gravatar_id":"","url":"https://api.github.com/users/code-corps","html_url":"https://github.com/code-corps","followers_url":"https://api.github.com/users/code-corps/followers","following_url":"https://api.github.com/users/code-corps/following{/other_user}","gists_url":"https://api.github.com/users/code-corps/gists{/gist_id}","starred_url":"https://api.github.com/users/code-corps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-corps/subscriptions","organizations_url":"https://api.github.com/users/code-corps/orgs","repos_url":"https://api.github.com/users/code-corps/repos","events_url":"https://api.github.com/users/code-corps/events{/privacy}","received_events_url":"https://api.github.com/users/code-corps/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/code-corps/code-corps-phoenix","description":"Phoenix API for the Code Corps platform.","fork":false,"url":"https://api.github.com/repos/code-corps/code-corps-phoenix","forks_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/forks","keys_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/teams","hooks_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/hooks","issue_events_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/issues/events{/number}","events_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/events","assignees_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/assignees{/user}","branches_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/branches{/branch}","tags_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/tags","blobs_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/statuses/{sha}","languages_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/languages","stargazers_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/stargazers","contributors_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/contributors","subscribers_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/subscribers","subscription_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/subscription","commits_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/contents/{+path}","compare_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/merges","archive_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/downloads","issues_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/issues{/number}","pulls_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/pulls{/number}","milestones_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/milestones{/number}","notifications_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/labels{/name}","releases_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/releases{/id}","deployments_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/deployments","created_at":"2016-07-16T18:49:25Z","updated_at":"2016-08-18T01:54:20Z","pushed_at":"2016-08-24T22:59:37Z","git_url":"git://github.com/code-corps/code-corps-phoenix.git","ssh_url":"git@github.com:code-corps/code-corps-phoenix.git","clone_url":"https://github.com/code-corps/code-corps-phoenix.git","svn_url":"https://github.com/code-corps/code-corps-phoenix","homepage":null,"size":240,"stargazers_count":10,"watchers_count":10,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":53,"forks":3,"open_issues":53,"watchers":10,"default_branch":"develop"}},"base":{"label":"code-corps:develop","ref":"develop","sha":"c787189c506edd32db45ca980c6f87fa2113bf02","user":{"login":"code-corps","id":12991115,"avatar_url":"https://avatars.githubusercontent.com/u/12991115?v=3","gravatar_id":"","url":"https://api.github.com/users/code-corps","html_url":"https://github.com/code-corps","followers_url":"https://api.github.com/users/code-corps/followers","following_url":"https://api.github.com/users/code-corps/following{/other_user}","gists_url":"https://api.github.com/users/code-corps/gists{/gist_id}","starred_url":"https://api.github.com/users/code-corps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-corps/subscriptions","organizations_url":"https://api.github.com/users/code-corps/orgs","repos_url":"https://api.github.com/users/code-corps/repos","events_url":"https://api.github.com/users/code-corps/events{/privacy}","received_events_url":"https://api.github.com/users/code-corps/received_events","type":"Organization","site_admin":false},"repo":{"id":63497734,"name":"code-corps-phoenix","full_name":"code-corps/code-corps-phoenix","owner":{"login":"code-corps","id":12991115,"avatar_url":"https://avatars.githubusercontent.com/u/12991115?v=3","gravatar_id":"","url":"https://api.github.com/users/code-corps","html_url":"https://github.com/code-corps","followers_url":"https://api.github.com/users/code-corps/followers","following_url":"https://api.github.com/users/code-corps/following{/other_user}","gists_url":"https://api.github.com/users/code-corps/gists{/gist_id}","starred_url":"https://api.github.com/users/code-corps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-corps/subscriptions","organizations_url":"https://api.github.com/users/code-corps/orgs","repos_url":"https://api.github.com/users/code-corps/repos","events_url":"https://api.github.com/users/code-corps/events{/privacy}","received_events_url":"https://api.github.com/users/code-corps/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/code-corps/code-corps-phoenix","description":"Phoenix API for the Code Corps platform.","fork":false,"url":"https://api.github.com/repos/code-corps/code-corps-phoenix","forks_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/forks","keys_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/teams","hooks_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/hooks","issue_events_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/issues/events{/number}","events_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/events","assignees_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/assignees{/user}","branches_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/branches{/branch}","tags_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/tags","blobs_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/statuses/{sha}","languages_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/languages","stargazers_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/stargazers","contributors_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/contributors","subscribers_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/subscribers","subscription_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/subscription","commits_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/contents/{+path}","compare_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/merges","archive_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/downloads","issues_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/issues{/number}","pulls_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/pulls{/number}","milestones_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/milestones{/number}","notifications_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/labels{/name}","releases_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/releases{/id}","deployments_url":"https://api.github.com/repos/code-corps/code-corps-phoenix/deployments","created_at":"2016-07-16T18:49:25Z","updated_at":"2016-08-18T01:54:20Z","pushed_at":"2016-08-24T22:59:37Z","git_url":"git://github.com/code-corps/code-corps-phoenix.git","ssh_url":"git@github.com:code-corps/code-corps-phoenix.git","clone_url":"https://github.com/code-corps/code-corps-phoenix.git","svn_url":"https://github.com/code-corps/code-corps-phoenix","homepage":null,"size":240,"stargazers_count":10,"watchers_count":10,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":53,"forks":3,"open_issues":53,"watchers":10,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/code-corps/code-corps-phoenix/pulls/139"},"html":{"href":"https://github.com/code-corps/code-corps-phoenix/pull/139"},"issue":{"href":"https://api.github.com/repos/code-corps/code-corps-phoenix/issues/139"},"comments":{"href":"https://api.github.com/repos/code-corps/code-corps-phoenix/issues/139/comments"},"review_comments":{"href":"https://api.github.com/repos/code-corps/code-corps-phoenix/pulls/139/comments"},"review_comment":{"href":"https://api.github.com/repos/code-corps/code-corps-phoenix/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/code-corps/code-corps-phoenix/pulls/139/commits"},"statuses":{"href":"https://api.github.com/repos/code-corps/code-corps-phoenix/statuses/7f956893272a66ade0311fca03665fddc28f1d92"}}}}
{"actor":{"display_login":"JoshSmith"}}