{"action":"created","comment":{"url":"https://api.github.com/repos/osu-cass/AP-CSE-API/pulls/comments/229909696","pull_request_review_id":170521685,"id":229909696,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyOTkwOTY5Ng==","diff_hunk":"@@ -0,0 +1,30 @@\n+import { Request } from 'express';\n+import { Health, setRouteHealth } from '../health';\n+import { CSEResponse } from '../../server';\n+import { IFilterParams } from '../';\n+import { applyTracing } from '../../utils/tracer';\n+import { IFilterOptions } from '../../models/filter';\n+\n+export const handler = async (req: Request, res: CSEResponse) => {\n+  const { dbClient } = res.locals;\n+  const { grades, subject, claimNumber }: IFilterParams = <IFilterParams>req.query;\n+  let result: IFilterOptions | undefined;\n+  try {\n+    await dbClient.connect();\n+    if (grades && subject && claimNumber) {\n+      result = await dbClient.getTargetShortCodes(grades, subject, claimNumber);\n+    } else if (grades && subject) {\n+      result = await dbClient.getClaimNumbers(grades, subject);\n+    } else {\n+      result = await dbClient.getSubjectsAndGrades();\n+    }\n+    await dbClient.close();\n+  } catch (error) {\n+    res.status(500);\n+    res.send(error);\n+  }\n+  res.status(200);\n+  res.send(result);","path":"src/routes/filter/index.ts","position":27,"original_position":27,"commit_id":"563fa5af2cff60f127149bbb4438daf1ca24aa8c","original_commit_id":"563fa5af2cff60f127149bbb4438daf1ca24aa8c","user":{"login":"puregarlic","id":4955937,"node_id":"MDQ6VXNlcjQ5NTU5Mzc=","avatar_url":"https://avatars1.githubusercontent.com/u/4955937?v=4","gravatar_id":"","url":"https://api.github.com/users/puregarlic","html_url":"https://github.com/puregarlic","followers_url":"https://api.github.com/users/puregarlic/followers","following_url":"https://api.github.com/users/puregarlic/following{/other_user}","gists_url":"https://api.github.com/users/puregarlic/gists{/gist_id}","starred_url":"https://api.github.com/users/puregarlic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puregarlic/subscriptions","organizations_url":"https://api.github.com/users/puregarlic/orgs","repos_url":"https://api.github.com/users/puregarlic/repos","events_url":"https://api.github.com/users/puregarlic/events{/privacy}","received_events_url":"https://api.github.com/users/puregarlic/received_events","type":"User","site_admin":false},"body":"This line and the line above should be moved into the `try/catch` statement, in the `try` branch. If an error is thrown, Express is going to try and set the status and then send the response again.","created_at":"2018-11-01T00:34:02Z","updated_at":"2018-11-01T00:34:29Z","html_url":"https://github.com/osu-cass/AP-CSE-API/pull/20#discussion_r229909696","pull_request_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/pulls/20","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/osu-cass/AP-CSE-API/pulls/comments/229909696"},"html":{"href":"https://github.com/osu-cass/AP-CSE-API/pull/20#discussion_r229909696"},"pull_request":{"href":"https://api.github.com/repos/osu-cass/AP-CSE-API/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/osu-cass/AP-CSE-API/pulls/20","id":225955882,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1OTU1ODgy","html_url":"https://github.com/osu-cass/AP-CSE-API/pull/20","diff_url":"https://github.com/osu-cass/AP-CSE-API/pull/20.diff","patch_url":"https://github.com/osu-cass/AP-CSE-API/pull/20.patch","issue_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/issues/20","number":20,"state":"open","locked":false,"title":"Feat/cse 304 create api endpoints to generate filter values","user":{"login":"danvanhorn","id":12438018,"node_id":"MDQ6VXNlcjEyNDM4MDE4","avatar_url":"https://avatars0.githubusercontent.com/u/12438018?v=4","gravatar_id":"","url":"https://api.github.com/users/danvanhorn","html_url":"https://github.com/danvanhorn","followers_url":"https://api.github.com/users/danvanhorn/followers","following_url":"https://api.github.com/users/danvanhorn/following{/other_user}","gists_url":"https://api.github.com/users/danvanhorn/gists{/gist_id}","starred_url":"https://api.github.com/users/danvanhorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danvanhorn/subscriptions","organizations_url":"https://api.github.com/users/danvanhorn/orgs","repos_url":"https://api.github.com/users/danvanhorn/repos","events_url":"https://api.github.com/users/danvanhorn/events{/privacy}","received_events_url":"https://api.github.com/users/danvanhorn/received_events","type":"User","site_admin":false},"body":"# Changes introduced\r\n\r\n_describe changes here_\r\n\r\n## Related issue(s):\r\n\r\n- CSE-298\r\n- CSE-304 \r\n\r\n## Contributor checklist\r\n\r\n- [x] Wrote/updated tests for introduced changes\r\n- [ ] ~~Added new stories for created/modified components (if applicable)~~\r\n- [x] Updated Postman library for created/modified routes (if applicable)\r\n- [x] Verified that there are no issues in CircleCI\r\n- [x] Assigned yourself to the PR\r\n- [x] Removed `WIP:` from the PR title\r\n- [x] Requested review from the SB Reviewers team\r\n\r\n## Reviewer checklist\r\n\r\n- [ ] Assigned yourself to the PR\r\n- [ ] Read through the changes in the `Files changed` tab\r\n- [ ] Verified that tests were written/modified\r\n- [ ] ~~Verified that stories were written/modified (if applicable)~~\r\n- [ ] Verified that Postman was updated (if applicable)\r\n- [ ] Checked out the branch and tested changes locally\r\n","created_at":"2018-10-26T02:10:32Z","updated_at":"2018-11-01T00:34:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"db5e0f94279b539b43c27fe2cbd25b2848e9bf53","assignee":{"login":"danvanhorn","id":12438018,"node_id":"MDQ6VXNlcjEyNDM4MDE4","avatar_url":"https://avatars0.githubusercontent.com/u/12438018?v=4","gravatar_id":"","url":"https://api.github.com/users/danvanhorn","html_url":"https://github.com/danvanhorn","followers_url":"https://api.github.com/users/danvanhorn/followers","following_url":"https://api.github.com/users/danvanhorn/following{/other_user}","gists_url":"https://api.github.com/users/danvanhorn/gists{/gist_id}","starred_url":"https://api.github.com/users/danvanhorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danvanhorn/subscriptions","organizations_url":"https://api.github.com/users/danvanhorn/orgs","repos_url":"https://api.github.com/users/danvanhorn/repos","events_url":"https://api.github.com/users/danvanhorn/events{/privacy}","received_events_url":"https://api.github.com/users/danvanhorn/received_events","type":"User","site_admin":false},"assignees":[{"login":"danvanhorn","id":12438018,"node_id":"MDQ6VXNlcjEyNDM4MDE4","avatar_url":"https://avatars0.githubusercontent.com/u/12438018?v=4","gravatar_id":"","url":"https://api.github.com/users/danvanhorn","html_url":"https://github.com/danvanhorn","followers_url":"https://api.github.com/users/danvanhorn/followers","following_url":"https://api.github.com/users/danvanhorn/following{/other_user}","gists_url":"https://api.github.com/users/danvanhorn/gists{/gist_id}","starred_url":"https://api.github.com/users/danvanhorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danvanhorn/subscriptions","organizations_url":"https://api.github.com/users/danvanhorn/orgs","repos_url":"https://api.github.com/users/danvanhorn/repos","events_url":"https://api.github.com/users/danvanhorn/events{/privacy}","received_events_url":"https://api.github.com/users/danvanhorn/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/pulls/20/commits","review_comments_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/pulls/20/comments","review_comment_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/pulls/comments{/number}","comments_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/issues/20/comments","statuses_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/statuses/563fa5af2cff60f127149bbb4438daf1ca24aa8c","head":{"label":"osu-cass:feat/CSE-304-create-api-endpoints-to-generate-filter-values","ref":"feat/CSE-304-create-api-endpoints-to-generate-filter-values","sha":"563fa5af2cff60f127149bbb4438daf1ca24aa8c","user":{"login":"osu-cass","id":8293685,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgyOTM2ODU=","avatar_url":"https://avatars0.githubusercontent.com/u/8293685?v=4","gravatar_id":"","url":"https://api.github.com/users/osu-cass","html_url":"https://github.com/osu-cass","followers_url":"https://api.github.com/users/osu-cass/followers","following_url":"https://api.github.com/users/osu-cass/following{/other_user}","gists_url":"https://api.github.com/users/osu-cass/gists{/gist_id}","starred_url":"https://api.github.com/users/osu-cass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osu-cass/subscriptions","organizations_url":"https://api.github.com/users/osu-cass/orgs","repos_url":"https://api.github.com/users/osu-cass/repos","events_url":"https://api.github.com/users/osu-cass/events{/privacy}","received_events_url":"https://api.github.com/users/osu-cass/received_events","type":"Organization","site_admin":false},"repo":{"id":143040840,"node_id":"MDEwOlJlcG9zaXRvcnkxNDMwNDA4NDA=","name":"AP-CSE-API","full_name":"osu-cass/AP-CSE-API","private":false,"owner":{"login":"osu-cass","id":8293685,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgyOTM2ODU=","avatar_url":"https://avatars0.githubusercontent.com/u/8293685?v=4","gravatar_id":"","url":"https://api.github.com/users/osu-cass","html_url":"https://github.com/osu-cass","followers_url":"https://api.github.com/users/osu-cass/followers","following_url":"https://api.github.com/users/osu-cass/following{/other_user}","gists_url":"https://api.github.com/users/osu-cass/gists{/gist_id}","starred_url":"https://api.github.com/users/osu-cass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osu-cass/subscriptions","organizations_url":"https://api.github.com/users/osu-cass/orgs","repos_url":"https://api.github.com/users/osu-cass/repos","events_url":"https://api.github.com/users/osu-cass/events{/privacy}","received_events_url":"https://api.github.com/users/osu-cass/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/osu-cass/AP-CSE-API","description":"API for Content Specification Explorer","fork":false,"url":"https://api.github.com/repos/osu-cass/AP-CSE-API","forks_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/forks","keys_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/keys{/key_id}","collaborators_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/teams","hooks_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/hooks","issue_events_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/issues/events{/number}","events_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/events","assignees_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/assignees{/user}","branches_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/branches{/branch}","tags_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/tags","blobs_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/git/refs{/sha}","trees_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/git/trees{/sha}","statuses_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/statuses/{sha}","languages_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/languages","stargazers_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/stargazers","contributors_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/contributors","subscribers_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/subscribers","subscription_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/subscription","commits_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/commits{/sha}","git_commits_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/git/commits{/sha}","comments_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/comments{/number}","issue_comment_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/issues/comments{/number}","contents_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/contents/{+path}","compare_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/compare/{base}...{head}","merges_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/merges","archive_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/downloads","issues_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/issues{/number}","pulls_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/pulls{/number}","milestones_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/milestones{/number}","notifications_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/labels{/name}","releases_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/releases{/id}","deployments_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/deployments","created_at":"2018-07-31T16:39:51Z","updated_at":"2018-10-31T22:54:34Z","pushed_at":"2018-11-01T00:06:01Z","git_url":"git://github.com/osu-cass/AP-CSE-API.git","ssh_url":"git@github.com:osu-cass/AP-CSE-API.git","clone_url":"https://github.com/osu-cass/AP-CSE-API.git","svn_url":"https://github.com/osu-cass/AP-CSE-API","homepage":null,"size":3252,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"dev"}},"base":{"label":"osu-cass:dev","ref":"dev","sha":"d0865582cf8dd0a6e36516d566ec9e983d5cdb60","user":{"login":"osu-cass","id":8293685,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgyOTM2ODU=","avatar_url":"https://avatars0.githubusercontent.com/u/8293685?v=4","gravatar_id":"","url":"https://api.github.com/users/osu-cass","html_url":"https://github.com/osu-cass","followers_url":"https://api.github.com/users/osu-cass/followers","following_url":"https://api.github.com/users/osu-cass/following{/other_user}","gists_url":"https://api.github.com/users/osu-cass/gists{/gist_id}","starred_url":"https://api.github.com/users/osu-cass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osu-cass/subscriptions","organizations_url":"https://api.github.com/users/osu-cass/orgs","repos_url":"https://api.github.com/users/osu-cass/repos","events_url":"https://api.github.com/users/osu-cass/events{/privacy}","received_events_url":"https://api.github.com/users/osu-cass/received_events","type":"Organization","site_admin":false},"repo":{"id":143040840,"node_id":"MDEwOlJlcG9zaXRvcnkxNDMwNDA4NDA=","name":"AP-CSE-API","full_name":"osu-cass/AP-CSE-API","private":false,"owner":{"login":"osu-cass","id":8293685,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgyOTM2ODU=","avatar_url":"https://avatars0.githubusercontent.com/u/8293685?v=4","gravatar_id":"","url":"https://api.github.com/users/osu-cass","html_url":"https://github.com/osu-cass","followers_url":"https://api.github.com/users/osu-cass/followers","following_url":"https://api.github.com/users/osu-cass/following{/other_user}","gists_url":"https://api.github.com/users/osu-cass/gists{/gist_id}","starred_url":"https://api.github.com/users/osu-cass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osu-cass/subscriptions","organizations_url":"https://api.github.com/users/osu-cass/orgs","repos_url":"https://api.github.com/users/osu-cass/repos","events_url":"https://api.github.com/users/osu-cass/events{/privacy}","received_events_url":"https://api.github.com/users/osu-cass/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/osu-cass/AP-CSE-API","description":"API for Content Specification Explorer","fork":false,"url":"https://api.github.com/repos/osu-cass/AP-CSE-API","forks_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/forks","keys_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/keys{/key_id}","collaborators_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/teams","hooks_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/hooks","issue_events_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/issues/events{/number}","events_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/events","assignees_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/assignees{/user}","branches_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/branches{/branch}","tags_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/tags","blobs_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/git/refs{/sha}","trees_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/git/trees{/sha}","statuses_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/statuses/{sha}","languages_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/languages","stargazers_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/stargazers","contributors_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/contributors","subscribers_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/subscribers","subscription_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/subscription","commits_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/commits{/sha}","git_commits_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/git/commits{/sha}","comments_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/comments{/number}","issue_comment_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/issues/comments{/number}","contents_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/contents/{+path}","compare_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/compare/{base}...{head}","merges_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/merges","archive_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/downloads","issues_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/issues{/number}","pulls_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/pulls{/number}","milestones_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/milestones{/number}","notifications_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/labels{/name}","releases_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/releases{/id}","deployments_url":"https://api.github.com/repos/osu-cass/AP-CSE-API/deployments","created_at":"2018-07-31T16:39:51Z","updated_at":"2018-10-31T22:54:34Z","pushed_at":"2018-11-01T00:06:01Z","git_url":"git://github.com/osu-cass/AP-CSE-API.git","ssh_url":"git@github.com:osu-cass/AP-CSE-API.git","clone_url":"https://github.com/osu-cass/AP-CSE-API.git","svn_url":"https://github.com/osu-cass/AP-CSE-API","homepage":null,"size":3252,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/osu-cass/AP-CSE-API/pulls/20"},"html":{"href":"https://github.com/osu-cass/AP-CSE-API/pull/20"},"issue":{"href":"https://api.github.com/repos/osu-cass/AP-CSE-API/issues/20"},"comments":{"href":"https://api.github.com/repos/osu-cass/AP-CSE-API/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/osu-cass/AP-CSE-API/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/osu-cass/AP-CSE-API/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/osu-cass/AP-CSE-API/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/osu-cass/AP-CSE-API/statuses/563fa5af2cff60f127149bbb4438daf1ca24aa8c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"puregarlic"}}