{"action":"created","comment":{"url":"https://api.github.com/repos/reddit/node-api-client/pulls/comments/81666307","pull_request_review_id":2629969,"id":81666307,"diff_hunk":"@@ -0,0 +1,28 @@\n+import { isEmpty } from 'lodash/lang';\n+\n+import apiRequest from '../apiBase/apiRequest';\n+import Subreddit from '../models2/Subreddit';\n+\n+const parseBody = (res, apiResponse) => {\n+  const { body } = res;\n+\n+  if (body.data && Array.isArray(body.data.children)) {\n+    body.data.children.forEach(c => apiResponse.addResult(Subreddit.fromJSON(c.data)));\n+    // sometimes, we get back empty object and 200 for invalid sorts like\n+    // `mine` when logged out\n+  } else if (!isEmpty(body)) {\n+    apiResponse.addResult(Subreddit.fromJSON(body.data || body));\n+  }\n+\n+  return apiResponse;\n+};\n+\n+const get = (apiOptions, query) => {\n+  return apiRequest(apiOptions, 'GET', 'api/similar_subreddits.json', { query })\n+      .then(apiResponse => {\n+        const { body: { json } } = apiResponse.response;\n+        return parseBody(apiResponse.response, apiResponse);","path":"src/apis/RecommendedSubreddits.es6.js","position":24,"original_position":24,"commit_id":"a3a787006130b441783aaeee9c3da2fdfa065a4f","original_commit_id":"a3a787006130b441783aaeee9c3da2fdfa065a4f","user":{"login":"schwers","id":307983,"avatar_url":"https://avatars.githubusercontent.com/u/307983?v=3","gravatar_id":"","url":"https://api.github.com/users/schwers","html_url":"https://github.com/schwers","followers_url":"https://api.github.com/users/schwers/followers","following_url":"https://api.github.com/users/schwers/following{/other_user}","gists_url":"https://api.github.com/users/schwers/gists{/gist_id}","starred_url":"https://api.github.com/users/schwers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schwers/subscriptions","organizations_url":"https://api.github.com/users/schwers/orgs","repos_url":"https://api.github.com/users/schwers/repos","events_url":"https://api.github.com/users/schwers/events{/privacy}","received_events_url":"https://api.github.com/users/schwers/received_events","type":"User","site_admin":false},"body":"since `parseBody` is already taking in the `apiResponse`, it might be cleaner to have `parseBody` extract the response. Then your `return` statement could be a one liner, similar to [PostsEndpoint.js](https://github.com/reddit/node-api-client/blob/3X/src/apis/PostsEndpoint.js#L87)","created_at":"2016-10-04T00:08:21Z","updated_at":"2016-10-04T00:08:22Z","html_url":"https://github.com/reddit/node-api-client/pull/162#discussion_r81666307","pull_request_url":"https://api.github.com/repos/reddit/node-api-client/pulls/162","_links":{"self":{"href":"https://api.github.com/repos/reddit/node-api-client/pulls/comments/81666307"},"html":{"href":"https://github.com/reddit/node-api-client/pull/162#discussion_r81666307"},"pull_request":{"href":"https://api.github.com/repos/reddit/node-api-client/pulls/162"}}},"pull_request":{"url":"https://api.github.com/repos/reddit/node-api-client/pulls/162","id":87813302,"html_url":"https://github.com/reddit/node-api-client/pull/162","diff_url":"https://github.com/reddit/node-api-client/pull/162.diff","patch_url":"https://github.com/reddit/node-api-client/pull/162.patch","issue_url":"https://api.github.com/repos/reddit/node-api-client/issues/162","number":162,"state":"open","locked":false,"title":"Add recommended subreddits endpoint","user":{"login":"scarow","id":3656897,"avatar_url":"https://avatars.githubusercontent.com/u/3656897?v=3","gravatar_id":"","url":"https://api.github.com/users/scarow","html_url":"https://github.com/scarow","followers_url":"https://api.github.com/users/scarow/followers","following_url":"https://api.github.com/users/scarow/following{/other_user}","gists_url":"https://api.github.com/users/scarow/gists{/gist_id}","starred_url":"https://api.github.com/users/scarow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scarow/subscriptions","organizations_url":"https://api.github.com/users/scarow/orgs","repos_url":"https://api.github.com/users/scarow/repos","events_url":"https://api.github.com/users/scarow/events{/privacy}","received_events_url":"https://api.github.com/users/scarow/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-03T23:58:15Z","updated_at":"2016-10-04T00:08:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"133c4af3a180c3d4150f1fef1f423e8379702142","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/reddit/node-api-client/pulls/162/commits","review_comments_url":"https://api.github.com/repos/reddit/node-api-client/pulls/162/comments","review_comment_url":"https://api.github.com/repos/reddit/node-api-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/reddit/node-api-client/issues/162/comments","statuses_url":"https://api.github.com/repos/reddit/node-api-client/statuses/a3a787006130b441783aaeee9c3da2fdfa065a4f","head":{"label":"scarow:WEB-2307","ref":"WEB-2307","sha":"a3a787006130b441783aaeee9c3da2fdfa065a4f","user":{"login":"scarow","id":3656897,"avatar_url":"https://avatars.githubusercontent.com/u/3656897?v=3","gravatar_id":"","url":"https://api.github.com/users/scarow","html_url":"https://github.com/scarow","followers_url":"https://api.github.com/users/scarow/followers","following_url":"https://api.github.com/users/scarow/following{/other_user}","gists_url":"https://api.github.com/users/scarow/gists{/gist_id}","starred_url":"https://api.github.com/users/scarow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scarow/subscriptions","organizations_url":"https://api.github.com/users/scarow/orgs","repos_url":"https://api.github.com/users/scarow/repos","events_url":"https://api.github.com/users/scarow/events{/privacy}","received_events_url":"https://api.github.com/users/scarow/received_events","type":"User","site_admin":false},"repo":{"id":69920846,"name":"node-api-client","full_name":"scarow/node-api-client","owner":{"login":"scarow","id":3656897,"avatar_url":"https://avatars.githubusercontent.com/u/3656897?v=3","gravatar_id":"","url":"https://api.github.com/users/scarow","html_url":"https://github.com/scarow","followers_url":"https://api.github.com/users/scarow/followers","following_url":"https://api.github.com/users/scarow/following{/other_user}","gists_url":"https://api.github.com/users/scarow/gists{/gist_id}","starred_url":"https://api.github.com/users/scarow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scarow/subscriptions","organizations_url":"https://api.github.com/users/scarow/orgs","repos_url":"https://api.github.com/users/scarow/repos","events_url":"https://api.github.com/users/scarow/events{/privacy}","received_events_url":"https://api.github.com/users/scarow/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/scarow/node-api-client","description":null,"fork":true,"url":"https://api.github.com/repos/scarow/node-api-client","forks_url":"https://api.github.com/repos/scarow/node-api-client/forks","keys_url":"https://api.github.com/repos/scarow/node-api-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scarow/node-api-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scarow/node-api-client/teams","hooks_url":"https://api.github.com/repos/scarow/node-api-client/hooks","issue_events_url":"https://api.github.com/repos/scarow/node-api-client/issues/events{/number}","events_url":"https://api.github.com/repos/scarow/node-api-client/events","assignees_url":"https://api.github.com/repos/scarow/node-api-client/assignees{/user}","branches_url":"https://api.github.com/repos/scarow/node-api-client/branches{/branch}","tags_url":"https://api.github.com/repos/scarow/node-api-client/tags","blobs_url":"https://api.github.com/repos/scarow/node-api-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scarow/node-api-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scarow/node-api-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/scarow/node-api-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scarow/node-api-client/statuses/{sha}","languages_url":"https://api.github.com/repos/scarow/node-api-client/languages","stargazers_url":"https://api.github.com/repos/scarow/node-api-client/stargazers","contributors_url":"https://api.github.com/repos/scarow/node-api-client/contributors","subscribers_url":"https://api.github.com/repos/scarow/node-api-client/subscribers","subscription_url":"https://api.github.com/repos/scarow/node-api-client/subscription","commits_url":"https://api.github.com/repos/scarow/node-api-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/scarow/node-api-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/scarow/node-api-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/scarow/node-api-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/scarow/node-api-client/contents/{+path}","compare_url":"https://api.github.com/repos/scarow/node-api-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scarow/node-api-client/merges","archive_url":"https://api.github.com/repos/scarow/node-api-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scarow/node-api-client/downloads","issues_url":"https://api.github.com/repos/scarow/node-api-client/issues{/number}","pulls_url":"https://api.github.com/repos/scarow/node-api-client/pulls{/number}","milestones_url":"https://api.github.com/repos/scarow/node-api-client/milestones{/number}","notifications_url":"https://api.github.com/repos/scarow/node-api-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scarow/node-api-client/labels{/name}","releases_url":"https://api.github.com/repos/scarow/node-api-client/releases{/id}","deployments_url":"https://api.github.com/repos/scarow/node-api-client/deployments","created_at":"2016-10-03T23:57:09Z","updated_at":"2016-10-03T23:57:10Z","pushed_at":"2016-10-04T00:01:23Z","git_url":"git://github.com/scarow/node-api-client.git","ssh_url":"git@github.com:scarow/node-api-client.git","clone_url":"https://github.com/scarow/node-api-client.git","svn_url":"https://github.com/scarow/node-api-client","homepage":null,"size":1061,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"reddit:3X","ref":"3X","sha":"408f6732ec99ac45ccb002fdfab379f48e032db2","user":{"login":"reddit","id":14248,"avatar_url":"https://avatars.githubusercontent.com/u/14248?v=3","gravatar_id":"","url":"https://api.github.com/users/reddit","html_url":"https://github.com/reddit","followers_url":"https://api.github.com/users/reddit/followers","following_url":"https://api.github.com/users/reddit/following{/other_user}","gists_url":"https://api.github.com/users/reddit/gists{/gist_id}","starred_url":"https://api.github.com/users/reddit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reddit/subscriptions","organizations_url":"https://api.github.com/users/reddit/orgs","repos_url":"https://api.github.com/users/reddit/repos","events_url":"https://api.github.com/users/reddit/events{/privacy}","received_events_url":"https://api.github.com/users/reddit/received_events","type":"Organization","site_admin":false},"repo":{"id":27147713,"name":"node-api-client","full_name":"reddit/node-api-client","owner":{"login":"reddit","id":14248,"avatar_url":"https://avatars.githubusercontent.com/u/14248?v=3","gravatar_id":"","url":"https://api.github.com/users/reddit","html_url":"https://github.com/reddit","followers_url":"https://api.github.com/users/reddit/followers","following_url":"https://api.github.com/users/reddit/following{/other_user}","gists_url":"https://api.github.com/users/reddit/gists{/gist_id}","starred_url":"https://api.github.com/users/reddit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reddit/subscriptions","organizations_url":"https://api.github.com/users/reddit/orgs","repos_url":"https://api.github.com/users/reddit/repos","events_url":"https://api.github.com/users/reddit/events{/privacy}","received_events_url":"https://api.github.com/users/reddit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/reddit/node-api-client","description":"","fork":false,"url":"https://api.github.com/repos/reddit/node-api-client","forks_url":"https://api.github.com/repos/reddit/node-api-client/forks","keys_url":"https://api.github.com/repos/reddit/node-api-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/reddit/node-api-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/reddit/node-api-client/teams","hooks_url":"https://api.github.com/repos/reddit/node-api-client/hooks","issue_events_url":"https://api.github.com/repos/reddit/node-api-client/issues/events{/number}","events_url":"https://api.github.com/repos/reddit/node-api-client/events","assignees_url":"https://api.github.com/repos/reddit/node-api-client/assignees{/user}","branches_url":"https://api.github.com/repos/reddit/node-api-client/branches{/branch}","tags_url":"https://api.github.com/repos/reddit/node-api-client/tags","blobs_url":"https://api.github.com/repos/reddit/node-api-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/reddit/node-api-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/reddit/node-api-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/reddit/node-api-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/reddit/node-api-client/statuses/{sha}","languages_url":"https://api.github.com/repos/reddit/node-api-client/languages","stargazers_url":"https://api.github.com/repos/reddit/node-api-client/stargazers","contributors_url":"https://api.github.com/repos/reddit/node-api-client/contributors","subscribers_url":"https://api.github.com/repos/reddit/node-api-client/subscribers","subscription_url":"https://api.github.com/repos/reddit/node-api-client/subscription","commits_url":"https://api.github.com/repos/reddit/node-api-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/reddit/node-api-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/reddit/node-api-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/reddit/node-api-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/reddit/node-api-client/contents/{+path}","compare_url":"https://api.github.com/repos/reddit/node-api-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/reddit/node-api-client/merges","archive_url":"https://api.github.com/repos/reddit/node-api-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/reddit/node-api-client/downloads","issues_url":"https://api.github.com/repos/reddit/node-api-client/issues{/number}","pulls_url":"https://api.github.com/repos/reddit/node-api-client/pulls{/number}","milestones_url":"https://api.github.com/repos/reddit/node-api-client/milestones{/number}","notifications_url":"https://api.github.com/repos/reddit/node-api-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/reddit/node-api-client/labels{/name}","releases_url":"https://api.github.com/repos/reddit/node-api-client/releases{/id}","deployments_url":"https://api.github.com/repos/reddit/node-api-client/deployments","created_at":"2014-11-25T21:51:35Z","updated_at":"2016-09-30T11:09:24Z","pushed_at":"2016-10-04T00:01:23Z","git_url":"git://github.com/reddit/node-api-client.git","ssh_url":"git@github.com:reddit/node-api-client.git","clone_url":"https://github.com/reddit/node-api-client.git","svn_url":"https://github.com/reddit/node-api-client","homepage":null,"size":1061,"stargazers_count":32,"watchers_count":32,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":5,"forks":21,"open_issues":5,"watchers":32,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/reddit/node-api-client/pulls/162"},"html":{"href":"https://github.com/reddit/node-api-client/pull/162"},"issue":{"href":"https://api.github.com/repos/reddit/node-api-client/issues/162"},"comments":{"href":"https://api.github.com/repos/reddit/node-api-client/issues/162/comments"},"review_comments":{"href":"https://api.github.com/repos/reddit/node-api-client/pulls/162/comments"},"review_comment":{"href":"https://api.github.com/repos/reddit/node-api-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/reddit/node-api-client/pulls/162/commits"},"statuses":{"href":"https://api.github.com/repos/reddit/node-api-client/statuses/a3a787006130b441783aaeee9c3da2fdfa065a4f"}}}}
{"actor":{"display_login":"schwers"}}