{"action":"created","comment":{"url":"https://api.github.com/repos/plausible-yeti/client-recon/pulls/comments/49105907","id":49105907,"diff_hunk":"@@ -0,0 +1,18 @@\n+var db = require('../config.js');\n+//This function gets all clients from salesperson_client for a specific salesperson\n+\n+\n+var getAllClientsString = \"SELECT * FROM client INNER JOIN salesperson_client on (salesperson_client.client_id = client.client_id) WHERE salesperson_client.salesperson_id = $1\"\n+\n+module.exports = function(salesPersonId, callback){\n+    return db.query(getAllClientsString, salesPersonId)\n+    .then(function(clients){\n+      callback(clients);\n+      return clients;\n+    })\n+    .catch(function(error){\n+      return error;","path":"db/psql/getAllClients.js","position":14,"original_position":14,"commit_id":"6d1192eb53a75c2cefeb2d883ba7be29d6ac8e1a","original_commit_id":"6d1192eb53a75c2cefeb2d883ba7be29d6ac8e1a","user":{"login":"rebeccaryang","id":13178670,"avatar_url":"https://avatars.githubusercontent.com/u/13178670?v=3","gravatar_id":"","url":"https://api.github.com/users/rebeccaryang","html_url":"https://github.com/rebeccaryang","followers_url":"https://api.github.com/users/rebeccaryang/followers","following_url":"https://api.github.com/users/rebeccaryang/following{/other_user}","gists_url":"https://api.github.com/users/rebeccaryang/gists{/gist_id}","starred_url":"https://api.github.com/users/rebeccaryang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rebeccaryang/subscriptions","organizations_url":"https://api.github.com/users/rebeccaryang/orgs","repos_url":"https://api.github.com/users/rebeccaryang/repos","events_url":"https://api.github.com/users/rebeccaryang/events{/privacy}","received_events_url":"https://api.github.com/users/rebeccaryang/received_events","type":"User","site_admin":false},"body":"callback(error,null) ?? ","created_at":"2016-01-07T18:21:17Z","updated_at":"2016-01-07T18:21:17Z","html_url":"https://github.com/plausible-yeti/client-recon/pull/29#discussion_r49105907","pull_request_url":"https://api.github.com/repos/plausible-yeti/client-recon/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/plausible-yeti/client-recon/pulls/comments/49105907"},"html":{"href":"https://github.com/plausible-yeti/client-recon/pull/29#discussion_r49105907"},"pull_request":{"href":"https://api.github.com/repos/plausible-yeti/client-recon/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/plausible-yeti/client-recon/pulls/29","id":55303505,"html_url":"https://github.com/plausible-yeti/client-recon/pull/29","diff_url":"https://github.com/plausible-yeti/client-recon/pull/29.diff","patch_url":"https://github.com/plausible-yeti/client-recon/pull/29.patch","issue_url":"https://api.github.com/repos/plausible-yeti/client-recon/issues/29","number":29,"state":"open","locked":false,"title":"Feature database schema","user":{"login":"alanzfu","id":7851211,"avatar_url":"https://avatars.githubusercontent.com/u/7851211?v=3","gravatar_id":"","url":"https://api.github.com/users/alanzfu","html_url":"https://github.com/alanzfu","followers_url":"https://api.github.com/users/alanzfu/followers","following_url":"https://api.github.com/users/alanzfu/following{/other_user}","gists_url":"https://api.github.com/users/alanzfu/gists{/gist_id}","starred_url":"https://api.github.com/users/alanzfu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alanzfu/subscriptions","organizations_url":"https://api.github.com/users/alanzfu/orgs","repos_url":"https://api.github.com/users/alanzfu/repos","events_url":"https://api.github.com/users/alanzfu/events{/privacy}","received_events_url":"https://api.github.com/users/alanzfu/received_events","type":"User","site_admin":false},"body":"#### What's this PR do?\r\n * fills out config file with db connection\r\n * uses pg-promise to create getAllClients method to interact with database\r\n\r\n#### What are the important parts of the code?\r\nconfig.js: creates connection\r\nschema.js: creates schemas for salesperson/client/salesperson_client\r\nindex.js: exports modules\r\npsql folder: holds all query strings in variables within their own js files\r\n\r\n#### How should this be tested by the reviewer?\r\n * if tables are created in a 'recon' database\r\n * if getAllClients returns an array of client objects\r\n\r\n#### Is any other information necessary to understand this?\r\n * to get postgres up and running, install postgresapp and follow instructructions. then create 'recon' database\r\n\r\n#### What are the relevant tickets? (Please add `closes`, `refs`, etc)\r\ncloses #2 \r\ncloses #4\r\n\r\n#### Screenshots (if appropriate)","created_at":"2016-01-07T06:11:59Z","updated_at":"2016-01-07T18:21:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0ed1dbc781d74fcfb9ba638b6a38d154a0e5c95c","assignee":{"login":"rebeccaryang","id":13178670,"avatar_url":"https://avatars.githubusercontent.com/u/13178670?v=3","gravatar_id":"","url":"https://api.github.com/users/rebeccaryang","html_url":"https://github.com/rebeccaryang","followers_url":"https://api.github.com/users/rebeccaryang/followers","following_url":"https://api.github.com/users/rebeccaryang/following{/other_user}","gists_url":"https://api.github.com/users/rebeccaryang/gists{/gist_id}","starred_url":"https://api.github.com/users/rebeccaryang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rebeccaryang/subscriptions","organizations_url":"https://api.github.com/users/rebeccaryang/orgs","repos_url":"https://api.github.com/users/rebeccaryang/repos","events_url":"https://api.github.com/users/rebeccaryang/events{/privacy}","received_events_url":"https://api.github.com/users/rebeccaryang/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/plausible-yeti/client-recon/pulls/29/commits","review_comments_url":"https://api.github.com/repos/plausible-yeti/client-recon/pulls/29/comments","review_comment_url":"https://api.github.com/repos/plausible-yeti/client-recon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/plausible-yeti/client-recon/issues/29/comments","statuses_url":"https://api.github.com/repos/plausible-yeti/client-recon/statuses/6d1192eb53a75c2cefeb2d883ba7be29d6ac8e1a","head":{"label":"alanzfu:feature-database-schema","ref":"feature-database-schema","sha":"6d1192eb53a75c2cefeb2d883ba7be29d6ac8e1a","user":{"login":"alanzfu","id":7851211,"avatar_url":"https://avatars.githubusercontent.com/u/7851211?v=3","gravatar_id":"","url":"https://api.github.com/users/alanzfu","html_url":"https://github.com/alanzfu","followers_url":"https://api.github.com/users/alanzfu/followers","following_url":"https://api.github.com/users/alanzfu/following{/other_user}","gists_url":"https://api.github.com/users/alanzfu/gists{/gist_id}","starred_url":"https://api.github.com/users/alanzfu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alanzfu/subscriptions","organizations_url":"https://api.github.com/users/alanzfu/orgs","repos_url":"https://api.github.com/users/alanzfu/repos","events_url":"https://api.github.com/users/alanzfu/events{/privacy}","received_events_url":"https://api.github.com/users/alanzfu/received_events","type":"User","site_admin":false},"repo":{"id":49178562,"name":"client-recon","full_name":"alanzfu/client-recon","owner":{"login":"alanzfu","id":7851211,"avatar_url":"https://avatars.githubusercontent.com/u/7851211?v=3","gravatar_id":"","url":"https://api.github.com/users/alanzfu","html_url":"https://github.com/alanzfu","followers_url":"https://api.github.com/users/alanzfu/followers","following_url":"https://api.github.com/users/alanzfu/following{/other_user}","gists_url":"https://api.github.com/users/alanzfu/gists{/gist_id}","starred_url":"https://api.github.com/users/alanzfu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alanzfu/subscriptions","organizations_url":"https://api.github.com/users/alanzfu/orgs","repos_url":"https://api.github.com/users/alanzfu/repos","events_url":"https://api.github.com/users/alanzfu/events{/privacy}","received_events_url":"https://api.github.com/users/alanzfu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alanzfu/client-recon","description":"Sales and account management relationship augmentation engin","fork":true,"url":"https://api.github.com/repos/alanzfu/client-recon","forks_url":"https://api.github.com/repos/alanzfu/client-recon/forks","keys_url":"https://api.github.com/repos/alanzfu/client-recon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alanzfu/client-recon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alanzfu/client-recon/teams","hooks_url":"https://api.github.com/repos/alanzfu/client-recon/hooks","issue_events_url":"https://api.github.com/repos/alanzfu/client-recon/issues/events{/number}","events_url":"https://api.github.com/repos/alanzfu/client-recon/events","assignees_url":"https://api.github.com/repos/alanzfu/client-recon/assignees{/user}","branches_url":"https://api.github.com/repos/alanzfu/client-recon/branches{/branch}","tags_url":"https://api.github.com/repos/alanzfu/client-recon/tags","blobs_url":"https://api.github.com/repos/alanzfu/client-recon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alanzfu/client-recon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alanzfu/client-recon/git/refs{/sha}","trees_url":"https://api.github.com/repos/alanzfu/client-recon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alanzfu/client-recon/statuses/{sha}","languages_url":"https://api.github.com/repos/alanzfu/client-recon/languages","stargazers_url":"https://api.github.com/repos/alanzfu/client-recon/stargazers","contributors_url":"https://api.github.com/repos/alanzfu/client-recon/contributors","subscribers_url":"https://api.github.com/repos/alanzfu/client-recon/subscribers","subscription_url":"https://api.github.com/repos/alanzfu/client-recon/subscription","commits_url":"https://api.github.com/repos/alanzfu/client-recon/commits{/sha}","git_commits_url":"https://api.github.com/repos/alanzfu/client-recon/git/commits{/sha}","comments_url":"https://api.github.com/repos/alanzfu/client-recon/comments{/number}","issue_comment_url":"https://api.github.com/repos/alanzfu/client-recon/issues/comments{/number}","contents_url":"https://api.github.com/repos/alanzfu/client-recon/contents/{+path}","compare_url":"https://api.github.com/repos/alanzfu/client-recon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alanzfu/client-recon/merges","archive_url":"https://api.github.com/repos/alanzfu/client-recon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alanzfu/client-recon/downloads","issues_url":"https://api.github.com/repos/alanzfu/client-recon/issues{/number}","pulls_url":"https://api.github.com/repos/alanzfu/client-recon/pulls{/number}","milestones_url":"https://api.github.com/repos/alanzfu/client-recon/milestones{/number}","notifications_url":"https://api.github.com/repos/alanzfu/client-recon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alanzfu/client-recon/labels{/name}","releases_url":"https://api.github.com/repos/alanzfu/client-recon/releases{/id}","created_at":"2016-01-07T03:29:27Z","updated_at":"2016-01-07T03:29:28Z","pushed_at":"2016-01-07T07:44:49Z","git_url":"git://github.com/alanzfu/client-recon.git","ssh_url":"git@github.com:alanzfu/client-recon.git","clone_url":"https://github.com/alanzfu/client-recon.git","svn_url":"https://github.com/alanzfu/client-recon","homepage":null,"size":25,"stargazers_count":0,"watchers_count":0,"language":"HTML","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":"plausible-yeti:master","ref":"master","sha":"1c47d282e36dbee374f82cc52af17abda889c8cb","user":{"login":"plausible-yeti","id":16580822,"avatar_url":"https://avatars.githubusercontent.com/u/16580822?v=3","gravatar_id":"","url":"https://api.github.com/users/plausible-yeti","html_url":"https://github.com/plausible-yeti","followers_url":"https://api.github.com/users/plausible-yeti/followers","following_url":"https://api.github.com/users/plausible-yeti/following{/other_user}","gists_url":"https://api.github.com/users/plausible-yeti/gists{/gist_id}","starred_url":"https://api.github.com/users/plausible-yeti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plausible-yeti/subscriptions","organizations_url":"https://api.github.com/users/plausible-yeti/orgs","repos_url":"https://api.github.com/users/plausible-yeti/repos","events_url":"https://api.github.com/users/plausible-yeti/events{/privacy}","received_events_url":"https://api.github.com/users/plausible-yeti/received_events","type":"Organization","site_admin":false},"repo":{"id":49158873,"name":"client-recon","full_name":"plausible-yeti/client-recon","owner":{"login":"plausible-yeti","id":16580822,"avatar_url":"https://avatars.githubusercontent.com/u/16580822?v=3","gravatar_id":"","url":"https://api.github.com/users/plausible-yeti","html_url":"https://github.com/plausible-yeti","followers_url":"https://api.github.com/users/plausible-yeti/followers","following_url":"https://api.github.com/users/plausible-yeti/following{/other_user}","gists_url":"https://api.github.com/users/plausible-yeti/gists{/gist_id}","starred_url":"https://api.github.com/users/plausible-yeti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plausible-yeti/subscriptions","organizations_url":"https://api.github.com/users/plausible-yeti/orgs","repos_url":"https://api.github.com/users/plausible-yeti/repos","events_url":"https://api.github.com/users/plausible-yeti/events{/privacy}","received_events_url":"https://api.github.com/users/plausible-yeti/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/plausible-yeti/client-recon","description":"Sales and account management relationship augmentation engin","fork":false,"url":"https://api.github.com/repos/plausible-yeti/client-recon","forks_url":"https://api.github.com/repos/plausible-yeti/client-recon/forks","keys_url":"https://api.github.com/repos/plausible-yeti/client-recon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/plausible-yeti/client-recon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/plausible-yeti/client-recon/teams","hooks_url":"https://api.github.com/repos/plausible-yeti/client-recon/hooks","issue_events_url":"https://api.github.com/repos/plausible-yeti/client-recon/issues/events{/number}","events_url":"https://api.github.com/repos/plausible-yeti/client-recon/events","assignees_url":"https://api.github.com/repos/plausible-yeti/client-recon/assignees{/user}","branches_url":"https://api.github.com/repos/plausible-yeti/client-recon/branches{/branch}","tags_url":"https://api.github.com/repos/plausible-yeti/client-recon/tags","blobs_url":"https://api.github.com/repos/plausible-yeti/client-recon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/plausible-yeti/client-recon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/plausible-yeti/client-recon/git/refs{/sha}","trees_url":"https://api.github.com/repos/plausible-yeti/client-recon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/plausible-yeti/client-recon/statuses/{sha}","languages_url":"https://api.github.com/repos/plausible-yeti/client-recon/languages","stargazers_url":"https://api.github.com/repos/plausible-yeti/client-recon/stargazers","contributors_url":"https://api.github.com/repos/plausible-yeti/client-recon/contributors","subscribers_url":"https://api.github.com/repos/plausible-yeti/client-recon/subscribers","subscription_url":"https://api.github.com/repos/plausible-yeti/client-recon/subscription","commits_url":"https://api.github.com/repos/plausible-yeti/client-recon/commits{/sha}","git_commits_url":"https://api.github.com/repos/plausible-yeti/client-recon/git/commits{/sha}","comments_url":"https://api.github.com/repos/plausible-yeti/client-recon/comments{/number}","issue_comment_url":"https://api.github.com/repos/plausible-yeti/client-recon/issues/comments{/number}","contents_url":"https://api.github.com/repos/plausible-yeti/client-recon/contents/{+path}","compare_url":"https://api.github.com/repos/plausible-yeti/client-recon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/plausible-yeti/client-recon/merges","archive_url":"https://api.github.com/repos/plausible-yeti/client-recon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/plausible-yeti/client-recon/downloads","issues_url":"https://api.github.com/repos/plausible-yeti/client-recon/issues{/number}","pulls_url":"https://api.github.com/repos/plausible-yeti/client-recon/pulls{/number}","milestones_url":"https://api.github.com/repos/plausible-yeti/client-recon/milestones{/number}","notifications_url":"https://api.github.com/repos/plausible-yeti/client-recon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/plausible-yeti/client-recon/labels{/name}","releases_url":"https://api.github.com/repos/plausible-yeti/client-recon/releases{/id}","created_at":"2016-01-06T20:12:20Z","updated_at":"2016-01-06T22:37:57Z","pushed_at":"2016-01-07T18:18:59Z","git_url":"git://github.com/plausible-yeti/client-recon.git","ssh_url":"git@github.com:plausible-yeti/client-recon.git","clone_url":"https://github.com/plausible-yeti/client-recon.git","svn_url":"https://github.com/plausible-yeti/client-recon","homepage":null,"size":34,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":20,"forks":4,"open_issues":20,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/plausible-yeti/client-recon/pulls/29"},"html":{"href":"https://github.com/plausible-yeti/client-recon/pull/29"},"issue":{"href":"https://api.github.com/repos/plausible-yeti/client-recon/issues/29"},"comments":{"href":"https://api.github.com/repos/plausible-yeti/client-recon/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/plausible-yeti/client-recon/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/plausible-yeti/client-recon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/plausible-yeti/client-recon/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/plausible-yeti/client-recon/statuses/6d1192eb53a75c2cefeb2d883ba7be29d6ac8e1a"}}}}