{"action":"created","comment":{"url":"https://api.github.com/repos/Get-Hale/hale-aws/pulls/comments/94268285","pull_request_review_id":14799473,"id":94268285,"diff_hunk":"@@ -1,227 +1,105 @@\n var pg = require('pg');\n var config = require('../config.js');\n-var async = require('async');\n \n var interfaces = require('../interfaces');\n \n var pool = new pg.Pool(config.database);\n \n-var errorHeader = 'GetTrainerProfile';\n-var header = config.header;\n-var statusCode = config.statusCode;\n-var errorCode = config.errorCode;\n-var message = config.message;\n-var body = config.body;\n-\n-var response = {\n-        [statusCode]: 500,\n-        [body]: {\n-            [header] : errorHeader,\n-            [errorCode] : -1,\n-            [message] : ''\n-        }\n-    };\n /**\n @namespace /v1/trainer/profile\n @method GET\n-@param {String} event.cognito_id - identifier to request\n+@param {String} event.path.cognito_id - identifier to request\n @return {response} error if the trainer doesnt exist;\n else Trainer.class.toJSON()\n */\n module.exports.handler = (event, context, callback) => {\n-    // necessary since we initialize a client pool\n-    context.callbackWaitsForEmptyEventLoop = false;\n-\n-    console.log(errorHeader + \": \" + JSON.stringify(event));\n-\n-    var trainer;\n-    var gym;\n-    var tier;\n+    var response = {\n+      statusCode: 500,\n+      body: {\n+        errorHeader: 'GetTrainerProfile',\n+        errorCode: -1,\n+        message: ''\n+      }\n+    };\n \n     pool.connect(function(err, client, done) {\n-        if (err) {\n-            response[body][errorCode] = 1;\n-            response[body][message] = err;\n-            console.log(JSON.stringify(response));\n-            callback(JSON.stringify(response));\n+        if(err) {\n+          response.errorCode = 0;\n+          response.body.message = err;\n+          callback(JSON.stringify(response));","path":"trainer/env/dev/GetTrainerProfile/index.js","position":59,"original_position":59,"commit_id":"e1da8eac1bf5eb07b0ed7ee1f8560f39b922e2ee","original_commit_id":"e1da8eac1bf5eb07b0ed7ee1f8560f39b922e2ee","user":{"login":"anmolg","id":2329166,"avatar_url":"https://avatars.githubusercontent.com/u/2329166?v=3","gravatar_id":"","url":"https://api.github.com/users/anmolg","html_url":"https://github.com/anmolg","followers_url":"https://api.github.com/users/anmolg/followers","following_url":"https://api.github.com/users/anmolg/following{/other_user}","gists_url":"https://api.github.com/users/anmolg/gists{/gist_id}","starred_url":"https://api.github.com/users/anmolg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anmolg/subscriptions","organizations_url":"https://api.github.com/users/anmolg/orgs","repos_url":"https://api.github.com/users/anmolg/repos","events_url":"https://api.github.com/users/anmolg/events{/privacy}","received_events_url":"https://api.github.com/users/anmolg/received_events","type":"User","site_admin":false},"body":"something which I may be responsible for, but need to remove the stringify","created_at":"2016-12-31T03:27:02Z","updated_at":"2016-12-31T03:29:40Z","html_url":"https://github.com/Get-Hale/hale-aws/pull/76#discussion_r94268285","pull_request_url":"https://api.github.com/repos/Get-Hale/hale-aws/pulls/76","_links":{"self":{"href":"https://api.github.com/repos/Get-Hale/hale-aws/pulls/comments/94268285"},"html":{"href":"https://github.com/Get-Hale/hale-aws/pull/76#discussion_r94268285"},"pull_request":{"href":"https://api.github.com/repos/Get-Hale/hale-aws/pulls/76"}}},"pull_request":{"url":"https://api.github.com/repos/Get-Hale/hale-aws/pulls/76","id":99706381,"html_url":"https://github.com/Get-Hale/hale-aws/pull/76","diff_url":"https://github.com/Get-Hale/hale-aws/pull/76.diff","patch_url":"https://github.com/Get-Hale/hale-aws/pull/76.patch","issue_url":"https://api.github.com/repos/Get-Hale/hale-aws/issues/76","number":76,"state":"open","locked":false,"title":"Fixed inconsistencies between API Gateway and Lambda\t","user":{"login":"ELCHILEN0","id":476988,"avatar_url":"https://avatars.githubusercontent.com/u/476988?v=3","gravatar_id":"","url":"https://api.github.com/users/ELCHILEN0","html_url":"https://github.com/ELCHILEN0","followers_url":"https://api.github.com/users/ELCHILEN0/followers","following_url":"https://api.github.com/users/ELCHILEN0/following{/other_user}","gists_url":"https://api.github.com/users/ELCHILEN0/gists{/gist_id}","starred_url":"https://api.github.com/users/ELCHILEN0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ELCHILEN0/subscriptions","organizations_url":"https://api.github.com/users/ELCHILEN0/orgs","repos_url":"https://api.github.com/users/ELCHILEN0/repos","events_url":"https://api.github.com/users/ELCHILEN0/events{/privacy}","received_events_url":"https://api.github.com/users/ELCHILEN0/received_events","type":"User","site_admin":false},"body":"@anmolg Can you do the changes done here to the Trainee endpoints that I missed?  I will try to get to all of them later but it would help if you could update the trainee endpoints","created_at":"2016-12-29T22:44:54Z","updated_at":"2016-12-31T03:29:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"010790232c639dc9fb8f0e9eb637c15b33a0f07e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Get-Hale/hale-aws/pulls/76/commits","review_comments_url":"https://api.github.com/repos/Get-Hale/hale-aws/pulls/76/comments","review_comment_url":"https://api.github.com/repos/Get-Hale/hale-aws/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Get-Hale/hale-aws/issues/76/comments","statuses_url":"https://api.github.com/repos/Get-Hale/hale-aws/statuses/e1da8eac1bf5eb07b0ed7ee1f8560f39b922e2ee","head":{"label":"Get-Hale:jnani.weibel-fix","ref":"jnani.weibel-fix","sha":"e1da8eac1bf5eb07b0ed7ee1f8560f39b922e2ee","user":{"login":"Get-Hale","id":23085563,"avatar_url":"https://avatars.githubusercontent.com/u/23085563?v=3","gravatar_id":"","url":"https://api.github.com/users/Get-Hale","html_url":"https://github.com/Get-Hale","followers_url":"https://api.github.com/users/Get-Hale/followers","following_url":"https://api.github.com/users/Get-Hale/following{/other_user}","gists_url":"https://api.github.com/users/Get-Hale/gists{/gist_id}","starred_url":"https://api.github.com/users/Get-Hale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Get-Hale/subscriptions","organizations_url":"https://api.github.com/users/Get-Hale/orgs","repos_url":"https://api.github.com/users/Get-Hale/repos","events_url":"https://api.github.com/users/Get-Hale/events{/privacy}","received_events_url":"https://api.github.com/users/Get-Hale/received_events","type":"Organization","site_admin":false},"repo":{"id":73026928,"name":"hale-aws","full_name":"Get-Hale/hale-aws","owner":{"login":"Get-Hale","id":23085563,"avatar_url":"https://avatars.githubusercontent.com/u/23085563?v=3","gravatar_id":"","url":"https://api.github.com/users/Get-Hale","html_url":"https://github.com/Get-Hale","followers_url":"https://api.github.com/users/Get-Hale/followers","following_url":"https://api.github.com/users/Get-Hale/following{/other_user}","gists_url":"https://api.github.com/users/Get-Hale/gists{/gist_id}","starred_url":"https://api.github.com/users/Get-Hale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Get-Hale/subscriptions","organizations_url":"https://api.github.com/users/Get-Hale/orgs","repos_url":"https://api.github.com/users/Get-Hale/repos","events_url":"https://api.github.com/users/Get-Hale/events{/privacy}","received_events_url":"https://api.github.com/users/Get-Hale/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Get-Hale/hale-aws","description":null,"fork":false,"url":"https://api.github.com/repos/Get-Hale/hale-aws","forks_url":"https://api.github.com/repos/Get-Hale/hale-aws/forks","keys_url":"https://api.github.com/repos/Get-Hale/hale-aws/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Get-Hale/hale-aws/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Get-Hale/hale-aws/teams","hooks_url":"https://api.github.com/repos/Get-Hale/hale-aws/hooks","issue_events_url":"https://api.github.com/repos/Get-Hale/hale-aws/issues/events{/number}","events_url":"https://api.github.com/repos/Get-Hale/hale-aws/events","assignees_url":"https://api.github.com/repos/Get-Hale/hale-aws/assignees{/user}","branches_url":"https://api.github.com/repos/Get-Hale/hale-aws/branches{/branch}","tags_url":"https://api.github.com/repos/Get-Hale/hale-aws/tags","blobs_url":"https://api.github.com/repos/Get-Hale/hale-aws/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Get-Hale/hale-aws/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Get-Hale/hale-aws/git/refs{/sha}","trees_url":"https://api.github.com/repos/Get-Hale/hale-aws/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Get-Hale/hale-aws/statuses/{sha}","languages_url":"https://api.github.com/repos/Get-Hale/hale-aws/languages","stargazers_url":"https://api.github.com/repos/Get-Hale/hale-aws/stargazers","contributors_url":"https://api.github.com/repos/Get-Hale/hale-aws/contributors","subscribers_url":"https://api.github.com/repos/Get-Hale/hale-aws/subscribers","subscription_url":"https://api.github.com/repos/Get-Hale/hale-aws/subscription","commits_url":"https://api.github.com/repos/Get-Hale/hale-aws/commits{/sha}","git_commits_url":"https://api.github.com/repos/Get-Hale/hale-aws/git/commits{/sha}","comments_url":"https://api.github.com/repos/Get-Hale/hale-aws/comments{/number}","issue_comment_url":"https://api.github.com/repos/Get-Hale/hale-aws/issues/comments{/number}","contents_url":"https://api.github.com/repos/Get-Hale/hale-aws/contents/{+path}","compare_url":"https://api.github.com/repos/Get-Hale/hale-aws/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Get-Hale/hale-aws/merges","archive_url":"https://api.github.com/repos/Get-Hale/hale-aws/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Get-Hale/hale-aws/downloads","issues_url":"https://api.github.com/repos/Get-Hale/hale-aws/issues{/number}","pulls_url":"https://api.github.com/repos/Get-Hale/hale-aws/pulls{/number}","milestones_url":"https://api.github.com/repos/Get-Hale/hale-aws/milestones{/number}","notifications_url":"https://api.github.com/repos/Get-Hale/hale-aws/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Get-Hale/hale-aws/labels{/name}","releases_url":"https://api.github.com/repos/Get-Hale/hale-aws/releases{/id}","deployments_url":"https://api.github.com/repos/Get-Hale/hale-aws/deployments","created_at":"2016-11-06T23:55:16Z","updated_at":"2016-12-27T08:02:53Z","pushed_at":"2016-12-29T22:44:54Z","git_url":"git://github.com/Get-Hale/hale-aws.git","ssh_url":"git@github.com:Get-Hale/hale-aws.git","clone_url":"https://github.com/Get-Hale/hale-aws.git","svn_url":"https://github.com/Get-Hale/hale-aws","homepage":null,"size":1309,"stargazers_count":0,"watchers_count":0,"language":"PLpgSQL","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":24,"forks":0,"open_issues":24,"watchers":0,"default_branch":"master"}},"base":{"label":"Get-Hale:master","ref":"master","sha":"5e5787a95fe9d31d553918296805d5c52491645f","user":{"login":"Get-Hale","id":23085563,"avatar_url":"https://avatars.githubusercontent.com/u/23085563?v=3","gravatar_id":"","url":"https://api.github.com/users/Get-Hale","html_url":"https://github.com/Get-Hale","followers_url":"https://api.github.com/users/Get-Hale/followers","following_url":"https://api.github.com/users/Get-Hale/following{/other_user}","gists_url":"https://api.github.com/users/Get-Hale/gists{/gist_id}","starred_url":"https://api.github.com/users/Get-Hale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Get-Hale/subscriptions","organizations_url":"https://api.github.com/users/Get-Hale/orgs","repos_url":"https://api.github.com/users/Get-Hale/repos","events_url":"https://api.github.com/users/Get-Hale/events{/privacy}","received_events_url":"https://api.github.com/users/Get-Hale/received_events","type":"Organization","site_admin":false},"repo":{"id":73026928,"name":"hale-aws","full_name":"Get-Hale/hale-aws","owner":{"login":"Get-Hale","id":23085563,"avatar_url":"https://avatars.githubusercontent.com/u/23085563?v=3","gravatar_id":"","url":"https://api.github.com/users/Get-Hale","html_url":"https://github.com/Get-Hale","followers_url":"https://api.github.com/users/Get-Hale/followers","following_url":"https://api.github.com/users/Get-Hale/following{/other_user}","gists_url":"https://api.github.com/users/Get-Hale/gists{/gist_id}","starred_url":"https://api.github.com/users/Get-Hale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Get-Hale/subscriptions","organizations_url":"https://api.github.com/users/Get-Hale/orgs","repos_url":"https://api.github.com/users/Get-Hale/repos","events_url":"https://api.github.com/users/Get-Hale/events{/privacy}","received_events_url":"https://api.github.com/users/Get-Hale/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Get-Hale/hale-aws","description":null,"fork":false,"url":"https://api.github.com/repos/Get-Hale/hale-aws","forks_url":"https://api.github.com/repos/Get-Hale/hale-aws/forks","keys_url":"https://api.github.com/repos/Get-Hale/hale-aws/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Get-Hale/hale-aws/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Get-Hale/hale-aws/teams","hooks_url":"https://api.github.com/repos/Get-Hale/hale-aws/hooks","issue_events_url":"https://api.github.com/repos/Get-Hale/hale-aws/issues/events{/number}","events_url":"https://api.github.com/repos/Get-Hale/hale-aws/events","assignees_url":"https://api.github.com/repos/Get-Hale/hale-aws/assignees{/user}","branches_url":"https://api.github.com/repos/Get-Hale/hale-aws/branches{/branch}","tags_url":"https://api.github.com/repos/Get-Hale/hale-aws/tags","blobs_url":"https://api.github.com/repos/Get-Hale/hale-aws/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Get-Hale/hale-aws/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Get-Hale/hale-aws/git/refs{/sha}","trees_url":"https://api.github.com/repos/Get-Hale/hale-aws/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Get-Hale/hale-aws/statuses/{sha}","languages_url":"https://api.github.com/repos/Get-Hale/hale-aws/languages","stargazers_url":"https://api.github.com/repos/Get-Hale/hale-aws/stargazers","contributors_url":"https://api.github.com/repos/Get-Hale/hale-aws/contributors","subscribers_url":"https://api.github.com/repos/Get-Hale/hale-aws/subscribers","subscription_url":"https://api.github.com/repos/Get-Hale/hale-aws/subscription","commits_url":"https://api.github.com/repos/Get-Hale/hale-aws/commits{/sha}","git_commits_url":"https://api.github.com/repos/Get-Hale/hale-aws/git/commits{/sha}","comments_url":"https://api.github.com/repos/Get-Hale/hale-aws/comments{/number}","issue_comment_url":"https://api.github.com/repos/Get-Hale/hale-aws/issues/comments{/number}","contents_url":"https://api.github.com/repos/Get-Hale/hale-aws/contents/{+path}","compare_url":"https://api.github.com/repos/Get-Hale/hale-aws/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Get-Hale/hale-aws/merges","archive_url":"https://api.github.com/repos/Get-Hale/hale-aws/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Get-Hale/hale-aws/downloads","issues_url":"https://api.github.com/repos/Get-Hale/hale-aws/issues{/number}","pulls_url":"https://api.github.com/repos/Get-Hale/hale-aws/pulls{/number}","milestones_url":"https://api.github.com/repos/Get-Hale/hale-aws/milestones{/number}","notifications_url":"https://api.github.com/repos/Get-Hale/hale-aws/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Get-Hale/hale-aws/labels{/name}","releases_url":"https://api.github.com/repos/Get-Hale/hale-aws/releases{/id}","deployments_url":"https://api.github.com/repos/Get-Hale/hale-aws/deployments","created_at":"2016-11-06T23:55:16Z","updated_at":"2016-12-27T08:02:53Z","pushed_at":"2016-12-29T22:44:54Z","git_url":"git://github.com/Get-Hale/hale-aws.git","ssh_url":"git@github.com:Get-Hale/hale-aws.git","clone_url":"https://github.com/Get-Hale/hale-aws.git","svn_url":"https://github.com/Get-Hale/hale-aws","homepage":null,"size":1309,"stargazers_count":0,"watchers_count":0,"language":"PLpgSQL","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":24,"forks":0,"open_issues":24,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Get-Hale/hale-aws/pulls/76"},"html":{"href":"https://github.com/Get-Hale/hale-aws/pull/76"},"issue":{"href":"https://api.github.com/repos/Get-Hale/hale-aws/issues/76"},"comments":{"href":"https://api.github.com/repos/Get-Hale/hale-aws/issues/76/comments"},"review_comments":{"href":"https://api.github.com/repos/Get-Hale/hale-aws/pulls/76/comments"},"review_comment":{"href":"https://api.github.com/repos/Get-Hale/hale-aws/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Get-Hale/hale-aws/pulls/76/commits"},"statuses":{"href":"https://api.github.com/repos/Get-Hale/hale-aws/statuses/e1da8eac1bf5eb07b0ed7ee1f8560f39b922e2ee"}}}}
{"actor":{"display_login":"anmolg"}}