{"action":"created","comment":{"url":"https://api.github.com/repos/slco-2016/clientcomm/pulls/comments/78776498","id":78776498,"diff_hunk":"@@ -207,29 +207,19 @@ router.get(\"/clients\", (req, res) => {\n   }).catch(error500(res));  \n });\n \n-// TODO: If owner, show a list of all users to attribute client to\n-//       Same for supervisor, but limit only within department\n router.get(\"/clients/create\", (req, res) => {\n-  res.render(\"clients/create\");\n+  res.render(\"clients/create\", { users: null });\n });\n \n router.post(\"/clients/create\", (req, res) => {\n-  let userID = req.user.cmid;\n-  let first  = req.body.first;\n-  let middle = req.body.middle ? req.body.middle : \"\";\n-  let last   = req.body.last;\n-  let dob    = req.body.DOB;\n-  let so     = req.body.uniqueID1 ? req.body.uniqueID1 : null;\n-  let otn    = req.body.uniqueID2 ? req.body.uniqueID2 : null;\n-\n   Client.create(\n-          userID, \n-          first, \n-          middle, \n-          last, \n-          dob, \n-          otn, \n-          so\n+          req.user.cmid, \n+          req.body.first, \n+          req.body.middle ? req.body.middle : \"\", \n+          req.body.last, \n+          req.body.dob, \n+          req.body.uniqueID2 ? req.body.uniqueID2 : null, \n+          req.body.uniqueID1 ? req.body.uniqueID1 : null","path":"routes/user.js","position":34,"original_position":34,"commit_id":"38cb8e89136dab5674c2d75bd23e4e167774c8a7","original_commit_id":"38cb8e89136dab5674c2d75bd23e4e167774c8a7","user":{"login":"maxmcd","id":283903,"avatar_url":"https://avatars.githubusercontent.com/u/283903?v=3","gravatar_id":"","url":"https://api.github.com/users/maxmcd","html_url":"https://github.com/maxmcd","followers_url":"https://api.github.com/users/maxmcd/followers","following_url":"https://api.github.com/users/maxmcd/following{/other_user}","gists_url":"https://api.github.com/users/maxmcd/gists{/gist_id}","starred_url":"https://api.github.com/users/maxmcd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxmcd/subscriptions","organizations_url":"https://api.github.com/users/maxmcd/orgs","repos_url":"https://api.github.com/users/maxmcd/repos","events_url":"https://api.github.com/users/maxmcd/events{/privacy}","received_events_url":"https://api.github.com/users/maxmcd/received_events","type":"User","site_admin":false},"body":"Wouldn't necessarily do this. `let so = req.bodyUniqueID1` is making it clearer that the creation function wants a param called `so`. `so` should probably also have a better name.\r\n\r\nDefining parameters with inconsistent names into variables with correct names seems like a good step. \r\n\r\nAgain, this is a good time to point out that we should probably switch to dictionaries over ordered params for something like \"create\" so that the names are present in the function call. ","created_at":"2016-09-14T15:47:22Z","updated_at":"2016-09-14T15:47:23Z","html_url":"https://github.com/slco-2016/clientcomm/pull/162#discussion_r78776498","pull_request_url":"https://api.github.com/repos/slco-2016/clientcomm/pulls/162","_links":{"self":{"href":"https://api.github.com/repos/slco-2016/clientcomm/pulls/comments/78776498"},"html":{"href":"https://github.com/slco-2016/clientcomm/pull/162#discussion_r78776498"},"pull_request":{"href":"https://api.github.com/repos/slco-2016/clientcomm/pulls/162"}}},"pull_request":{"url":"https://api.github.com/repos/slco-2016/clientcomm/pulls/162","id":85251584,"html_url":"https://github.com/slco-2016/clientcomm/pull/162","diff_url":"https://github.com/slco-2016/clientcomm/pull/162.diff","patch_url":"https://github.com/slco-2016/clientcomm/pull/162.patch","issue_url":"https://api.github.com/repos/slco-2016/clientcomm/issues/162","number":162,"state":"open","locked":false,"title":"Two file struc","user":{"login":"kuanb","id":6053396,"avatar_url":"https://avatars.githubusercontent.com/u/6053396?v=3","gravatar_id":"","url":"https://api.github.com/users/kuanb","html_url":"https://github.com/kuanb","followers_url":"https://api.github.com/users/kuanb/followers","following_url":"https://api.github.com/users/kuanb/following{/other_user}","gists_url":"https://api.github.com/users/kuanb/gists{/gist_id}","starred_url":"https://api.github.com/users/kuanb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kuanb/subscriptions","organizations_url":"https://api.github.com/users/kuanb/orgs","repos_url":"https://api.github.com/users/kuanb/repos","events_url":"https://api.github.com/users/kuanb/events{/privacy}","received_events_url":"https://api.github.com/users/kuanb/received_events","type":"User","site_admin":false},"body":"This is the \"end\" of this large branch. Future branches will be smaller and more feature-specific. \r\n\r\nWhat has been done in this branch is that `org.js` and `user.js` both have basic functionality all mapped to buttons on hub frame and hub frame itself is of modular composition, only showing actions according to the user that is logged in.\r\n\r\nIssues still remain present with: \r\n1. Not all actions from `user` are replicated in `org`, just replicate for now","created_at":"2016-09-14T15:36:52Z","updated_at":"2016-09-14T15:47:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"118d06ccceb6072dc1eeb5a9d7d8e416c829b04c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/slco-2016/clientcomm/pulls/162/commits","review_comments_url":"https://api.github.com/repos/slco-2016/clientcomm/pulls/162/comments","review_comment_url":"https://api.github.com/repos/slco-2016/clientcomm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/slco-2016/clientcomm/issues/162/comments","statuses_url":"https://api.github.com/repos/slco-2016/clientcomm/statuses/38cb8e89136dab5674c2d75bd23e4e167774c8a7","head":{"label":"slco-2016:two-file-struc","ref":"two-file-struc","sha":"38cb8e89136dab5674c2d75bd23e4e167774c8a7","user":{"login":"slco-2016","id":17660597,"avatar_url":"https://avatars.githubusercontent.com/u/17660597?v=3","gravatar_id":"","url":"https://api.github.com/users/slco-2016","html_url":"https://github.com/slco-2016","followers_url":"https://api.github.com/users/slco-2016/followers","following_url":"https://api.github.com/users/slco-2016/following{/other_user}","gists_url":"https://api.github.com/users/slco-2016/gists{/gist_id}","starred_url":"https://api.github.com/users/slco-2016/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slco-2016/subscriptions","organizations_url":"https://api.github.com/users/slco-2016/orgs","repos_url":"https://api.github.com/users/slco-2016/repos","events_url":"https://api.github.com/users/slco-2016/events{/privacy}","received_events_url":"https://api.github.com/users/slco-2016/received_events","type":"Organization","site_admin":false},"repo":{"id":53177500,"name":"clientcomm","full_name":"slco-2016/clientcomm","owner":{"login":"slco-2016","id":17660597,"avatar_url":"https://avatars.githubusercontent.com/u/17660597?v=3","gravatar_id":"","url":"https://api.github.com/users/slco-2016","html_url":"https://github.com/slco-2016","followers_url":"https://api.github.com/users/slco-2016/followers","following_url":"https://api.github.com/users/slco-2016/following{/other_user}","gists_url":"https://api.github.com/users/slco-2016/gists{/gist_id}","starred_url":"https://api.github.com/users/slco-2016/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slco-2016/subscriptions","organizations_url":"https://api.github.com/users/slco-2016/orgs","repos_url":"https://api.github.com/users/slco-2016/repos","events_url":"https://api.github.com/users/slco-2016/events{/privacy}","received_events_url":"https://api.github.com/users/slco-2016/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/slco-2016/clientcomm","description":"Communications interface for case managers at CJS.","fork":false,"url":"https://api.github.com/repos/slco-2016/clientcomm","forks_url":"https://api.github.com/repos/slco-2016/clientcomm/forks","keys_url":"https://api.github.com/repos/slco-2016/clientcomm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/slco-2016/clientcomm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/slco-2016/clientcomm/teams","hooks_url":"https://api.github.com/repos/slco-2016/clientcomm/hooks","issue_events_url":"https://api.github.com/repos/slco-2016/clientcomm/issues/events{/number}","events_url":"https://api.github.com/repos/slco-2016/clientcomm/events","assignees_url":"https://api.github.com/repos/slco-2016/clientcomm/assignees{/user}","branches_url":"https://api.github.com/repos/slco-2016/clientcomm/branches{/branch}","tags_url":"https://api.github.com/repos/slco-2016/clientcomm/tags","blobs_url":"https://api.github.com/repos/slco-2016/clientcomm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/slco-2016/clientcomm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/slco-2016/clientcomm/git/refs{/sha}","trees_url":"https://api.github.com/repos/slco-2016/clientcomm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/slco-2016/clientcomm/statuses/{sha}","languages_url":"https://api.github.com/repos/slco-2016/clientcomm/languages","stargazers_url":"https://api.github.com/repos/slco-2016/clientcomm/stargazers","contributors_url":"https://api.github.com/repos/slco-2016/clientcomm/contributors","subscribers_url":"https://api.github.com/repos/slco-2016/clientcomm/subscribers","subscription_url":"https://api.github.com/repos/slco-2016/clientcomm/subscription","commits_url":"https://api.github.com/repos/slco-2016/clientcomm/commits{/sha}","git_commits_url":"https://api.github.com/repos/slco-2016/clientcomm/git/commits{/sha}","comments_url":"https://api.github.com/repos/slco-2016/clientcomm/comments{/number}","issue_comment_url":"https://api.github.com/repos/slco-2016/clientcomm/issues/comments{/number}","contents_url":"https://api.github.com/repos/slco-2016/clientcomm/contents/{+path}","compare_url":"https://api.github.com/repos/slco-2016/clientcomm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/slco-2016/clientcomm/merges","archive_url":"https://api.github.com/repos/slco-2016/clientcomm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/slco-2016/clientcomm/downloads","issues_url":"https://api.github.com/repos/slco-2016/clientcomm/issues{/number}","pulls_url":"https://api.github.com/repos/slco-2016/clientcomm/pulls{/number}","milestones_url":"https://api.github.com/repos/slco-2016/clientcomm/milestones{/number}","notifications_url":"https://api.github.com/repos/slco-2016/clientcomm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/slco-2016/clientcomm/labels{/name}","releases_url":"https://api.github.com/repos/slco-2016/clientcomm/releases{/id}","deployments_url":"https://api.github.com/repos/slco-2016/clientcomm/deployments","created_at":"2016-03-05T02:02:33Z","updated_at":"2016-09-07T09:22:44Z","pushed_at":"2016-09-14T15:43:09Z","git_url":"git://github.com/slco-2016/clientcomm.git","ssh_url":"git@github.com:slco-2016/clientcomm.git","clone_url":"https://github.com/slco-2016/clientcomm.git","svn_url":"https://github.com/slco-2016/clientcomm","homepage":"","size":2205,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":51,"forks":2,"open_issues":51,"watchers":5,"default_branch":"master"}},"base":{"label":"slco-2016:v4","ref":"v4","sha":"3747adde19bd0d47ad6118b2875fa976a3c6b08f","user":{"login":"slco-2016","id":17660597,"avatar_url":"https://avatars.githubusercontent.com/u/17660597?v=3","gravatar_id":"","url":"https://api.github.com/users/slco-2016","html_url":"https://github.com/slco-2016","followers_url":"https://api.github.com/users/slco-2016/followers","following_url":"https://api.github.com/users/slco-2016/following{/other_user}","gists_url":"https://api.github.com/users/slco-2016/gists{/gist_id}","starred_url":"https://api.github.com/users/slco-2016/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slco-2016/subscriptions","organizations_url":"https://api.github.com/users/slco-2016/orgs","repos_url":"https://api.github.com/users/slco-2016/repos","events_url":"https://api.github.com/users/slco-2016/events{/privacy}","received_events_url":"https://api.github.com/users/slco-2016/received_events","type":"Organization","site_admin":false},"repo":{"id":53177500,"name":"clientcomm","full_name":"slco-2016/clientcomm","owner":{"login":"slco-2016","id":17660597,"avatar_url":"https://avatars.githubusercontent.com/u/17660597?v=3","gravatar_id":"","url":"https://api.github.com/users/slco-2016","html_url":"https://github.com/slco-2016","followers_url":"https://api.github.com/users/slco-2016/followers","following_url":"https://api.github.com/users/slco-2016/following{/other_user}","gists_url":"https://api.github.com/users/slco-2016/gists{/gist_id}","starred_url":"https://api.github.com/users/slco-2016/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slco-2016/subscriptions","organizations_url":"https://api.github.com/users/slco-2016/orgs","repos_url":"https://api.github.com/users/slco-2016/repos","events_url":"https://api.github.com/users/slco-2016/events{/privacy}","received_events_url":"https://api.github.com/users/slco-2016/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/slco-2016/clientcomm","description":"Communications interface for case managers at CJS.","fork":false,"url":"https://api.github.com/repos/slco-2016/clientcomm","forks_url":"https://api.github.com/repos/slco-2016/clientcomm/forks","keys_url":"https://api.github.com/repos/slco-2016/clientcomm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/slco-2016/clientcomm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/slco-2016/clientcomm/teams","hooks_url":"https://api.github.com/repos/slco-2016/clientcomm/hooks","issue_events_url":"https://api.github.com/repos/slco-2016/clientcomm/issues/events{/number}","events_url":"https://api.github.com/repos/slco-2016/clientcomm/events","assignees_url":"https://api.github.com/repos/slco-2016/clientcomm/assignees{/user}","branches_url":"https://api.github.com/repos/slco-2016/clientcomm/branches{/branch}","tags_url":"https://api.github.com/repos/slco-2016/clientcomm/tags","blobs_url":"https://api.github.com/repos/slco-2016/clientcomm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/slco-2016/clientcomm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/slco-2016/clientcomm/git/refs{/sha}","trees_url":"https://api.github.com/repos/slco-2016/clientcomm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/slco-2016/clientcomm/statuses/{sha}","languages_url":"https://api.github.com/repos/slco-2016/clientcomm/languages","stargazers_url":"https://api.github.com/repos/slco-2016/clientcomm/stargazers","contributors_url":"https://api.github.com/repos/slco-2016/clientcomm/contributors","subscribers_url":"https://api.github.com/repos/slco-2016/clientcomm/subscribers","subscription_url":"https://api.github.com/repos/slco-2016/clientcomm/subscription","commits_url":"https://api.github.com/repos/slco-2016/clientcomm/commits{/sha}","git_commits_url":"https://api.github.com/repos/slco-2016/clientcomm/git/commits{/sha}","comments_url":"https://api.github.com/repos/slco-2016/clientcomm/comments{/number}","issue_comment_url":"https://api.github.com/repos/slco-2016/clientcomm/issues/comments{/number}","contents_url":"https://api.github.com/repos/slco-2016/clientcomm/contents/{+path}","compare_url":"https://api.github.com/repos/slco-2016/clientcomm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/slco-2016/clientcomm/merges","archive_url":"https://api.github.com/repos/slco-2016/clientcomm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/slco-2016/clientcomm/downloads","issues_url":"https://api.github.com/repos/slco-2016/clientcomm/issues{/number}","pulls_url":"https://api.github.com/repos/slco-2016/clientcomm/pulls{/number}","milestones_url":"https://api.github.com/repos/slco-2016/clientcomm/milestones{/number}","notifications_url":"https://api.github.com/repos/slco-2016/clientcomm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/slco-2016/clientcomm/labels{/name}","releases_url":"https://api.github.com/repos/slco-2016/clientcomm/releases{/id}","deployments_url":"https://api.github.com/repos/slco-2016/clientcomm/deployments","created_at":"2016-03-05T02:02:33Z","updated_at":"2016-09-07T09:22:44Z","pushed_at":"2016-09-14T15:43:09Z","git_url":"git://github.com/slco-2016/clientcomm.git","ssh_url":"git@github.com:slco-2016/clientcomm.git","clone_url":"https://github.com/slco-2016/clientcomm.git","svn_url":"https://github.com/slco-2016/clientcomm","homepage":"","size":2205,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":51,"forks":2,"open_issues":51,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/slco-2016/clientcomm/pulls/162"},"html":{"href":"https://github.com/slco-2016/clientcomm/pull/162"},"issue":{"href":"https://api.github.com/repos/slco-2016/clientcomm/issues/162"},"comments":{"href":"https://api.github.com/repos/slco-2016/clientcomm/issues/162/comments"},"review_comments":{"href":"https://api.github.com/repos/slco-2016/clientcomm/pulls/162/comments"},"review_comment":{"href":"https://api.github.com/repos/slco-2016/clientcomm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/slco-2016/clientcomm/pulls/162/commits"},"statuses":{"href":"https://api.github.com/repos/slco-2016/clientcomm/statuses/38cb8e89136dab5674c2d75bd23e4e167774c8a7"}}}}
{"actor":{"display_login":"maxmcd"}}