{"action":"created","comment":{"url":"https://api.github.com/repos/csc3092015/csc309a3/pulls/comments/36046380","id":36046380,"diff_hunk":"@@ -161,6 +162,49 @@ var postFormHandler = function(req, res){\n \t}, autherId);\n }\n \n+var uploadToDB = function(req, res){\n+\t// for convenience\n+\tvar user = req.user;\n+\t// connect-multipart creates this convenient req.files.file and its attributes\n+\t// connect-multipart module is imported in routes.js\n+\tvar file = req.files.file;\n+\n+\t// name photos by their user's name\n+\tvar name = user._userId;","path":"app/routesHandler.js","position":36,"original_position":36,"commit_id":"92d24cb4f2f2872141fe1e38340721ea7f205ae4","original_commit_id":"92d24cb4f2f2872141fe1e38340721ea7f205ae4","user":{"login":"wwjzxwjc","id":4072382,"avatar_url":"https://avatars.githubusercontent.com/u/4072382?v=3","gravatar_id":"","url":"https://api.github.com/users/wwjzxwjc","html_url":"https://github.com/wwjzxwjc","followers_url":"https://api.github.com/users/wwjzxwjc/followers","following_url":"https://api.github.com/users/wwjzxwjc/following{/other_user}","gists_url":"https://api.github.com/users/wwjzxwjc/gists{/gist_id}","starred_url":"https://api.github.com/users/wwjzxwjc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wwjzxwjc/subscriptions","organizations_url":"https://api.github.com/users/wwjzxwjc/orgs","repos_url":"https://api.github.com/users/wwjzxwjc/repos","events_url":"https://api.github.com/users/wwjzxwjc/events{/privacy}","received_events_url":"https://api.github.com/users/wwjzxwjc/received_events","type":"User","site_admin":false},"body":"From what i see on UserDAO side, you do not need to make id as unique\r\n","created_at":"2015-08-02T19:11:46Z","updated_at":"2015-08-02T19:11:46Z","html_url":"https://github.com/csc3092015/csc309a3/pull/40#discussion_r36046380","pull_request_url":"https://api.github.com/repos/csc3092015/csc309a3/pulls/40","_links":{"self":{"href":"https://api.github.com/repos/csc3092015/csc309a3/pulls/comments/36046380"},"html":{"href":"https://github.com/csc3092015/csc309a3/pull/40#discussion_r36046380"},"pull_request":{"href":"https://api.github.com/repos/csc3092015/csc309a3/pulls/40"}}},"pull_request":{"url":"https://api.github.com/repos/csc3092015/csc309a3/pulls/40","id":41421118,"html_url":"https://github.com/csc3092015/csc309a3/pull/40","diff_url":"https://github.com/csc3092015/csc309a3/pull/40.diff","patch_url":"https://github.com/csc3092015/csc309a3/pull/40.patch","issue_url":"https://api.github.com/repos/csc3092015/csc309a3/issues/40","number":40,"state":"open","locked":false,"title":"Tanke new","user":{"login":"elio303","id":12770678,"avatar_url":"https://avatars.githubusercontent.com/u/12770678?v=3","gravatar_id":"","url":"https://api.github.com/users/elio303","html_url":"https://github.com/elio303","followers_url":"https://api.github.com/users/elio303/followers","following_url":"https://api.github.com/users/elio303/following{/other_user}","gists_url":"https://api.github.com/users/elio303/gists{/gist_id}","starred_url":"https://api.github.com/users/elio303/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elio303/subscriptions","organizations_url":"https://api.github.com/users/elio303/orgs","repos_url":"https://api.github.com/users/elio303/repos","events_url":"https://api.github.com/users/elio303/events{/privacy}","received_events_url":"https://api.github.com/users/elio303/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-02T17:23:38Z","updated_at":"2015-08-02T19:11:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b12375d0c29d9bb24d1c167c88b05e9df1b6bec9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/csc3092015/csc309a3/pulls/40/commits","review_comments_url":"https://api.github.com/repos/csc3092015/csc309a3/pulls/40/comments","review_comment_url":"https://api.github.com/repos/csc3092015/csc309a3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/csc3092015/csc309a3/issues/40/comments","statuses_url":"https://api.github.com/repos/csc3092015/csc309a3/statuses/92d24cb4f2f2872141fe1e38340721ea7f205ae4","head":{"label":"csc3092015:TankeNew","ref":"TankeNew","sha":"92d24cb4f2f2872141fe1e38340721ea7f205ae4","user":{"login":"csc3092015","id":12770659,"avatar_url":"https://avatars.githubusercontent.com/u/12770659?v=3","gravatar_id":"","url":"https://api.github.com/users/csc3092015","html_url":"https://github.com/csc3092015","followers_url":"https://api.github.com/users/csc3092015/followers","following_url":"https://api.github.com/users/csc3092015/following{/other_user}","gists_url":"https://api.github.com/users/csc3092015/gists{/gist_id}","starred_url":"https://api.github.com/users/csc3092015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csc3092015/subscriptions","organizations_url":"https://api.github.com/users/csc3092015/orgs","repos_url":"https://api.github.com/users/csc3092015/repos","events_url":"https://api.github.com/users/csc3092015/events{/privacy}","received_events_url":"https://api.github.com/users/csc3092015/received_events","type":"Organization","site_admin":false},"repo":{"id":38139431,"name":"csc309a3","full_name":"csc3092015/csc309a3","owner":{"login":"csc3092015","id":12770659,"avatar_url":"https://avatars.githubusercontent.com/u/12770659?v=3","gravatar_id":"","url":"https://api.github.com/users/csc3092015","html_url":"https://github.com/csc3092015","followers_url":"https://api.github.com/users/csc3092015/followers","following_url":"https://api.github.com/users/csc3092015/following{/other_user}","gists_url":"https://api.github.com/users/csc3092015/gists{/gist_id}","starred_url":"https://api.github.com/users/csc3092015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csc3092015/subscriptions","organizations_url":"https://api.github.com/users/csc3092015/orgs","repos_url":"https://api.github.com/users/csc3092015/repos","events_url":"https://api.github.com/users/csc3092015/events{/privacy}","received_events_url":"https://api.github.com/users/csc3092015/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/csc3092015/csc309a3","description":"","fork":false,"url":"https://api.github.com/repos/csc3092015/csc309a3","forks_url":"https://api.github.com/repos/csc3092015/csc309a3/forks","keys_url":"https://api.github.com/repos/csc3092015/csc309a3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/csc3092015/csc309a3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/csc3092015/csc309a3/teams","hooks_url":"https://api.github.com/repos/csc3092015/csc309a3/hooks","issue_events_url":"https://api.github.com/repos/csc3092015/csc309a3/issues/events{/number}","events_url":"https://api.github.com/repos/csc3092015/csc309a3/events","assignees_url":"https://api.github.com/repos/csc3092015/csc309a3/assignees{/user}","branches_url":"https://api.github.com/repos/csc3092015/csc309a3/branches{/branch}","tags_url":"https://api.github.com/repos/csc3092015/csc309a3/tags","blobs_url":"https://api.github.com/repos/csc3092015/csc309a3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/csc3092015/csc309a3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/csc3092015/csc309a3/git/refs{/sha}","trees_url":"https://api.github.com/repos/csc3092015/csc309a3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/csc3092015/csc309a3/statuses/{sha}","languages_url":"https://api.github.com/repos/csc3092015/csc309a3/languages","stargazers_url":"https://api.github.com/repos/csc3092015/csc309a3/stargazers","contributors_url":"https://api.github.com/repos/csc3092015/csc309a3/contributors","subscribers_url":"https://api.github.com/repos/csc3092015/csc309a3/subscribers","subscription_url":"https://api.github.com/repos/csc3092015/csc309a3/subscription","commits_url":"https://api.github.com/repos/csc3092015/csc309a3/commits{/sha}","git_commits_url":"https://api.github.com/repos/csc3092015/csc309a3/git/commits{/sha}","comments_url":"https://api.github.com/repos/csc3092015/csc309a3/comments{/number}","issue_comment_url":"https://api.github.com/repos/csc3092015/csc309a3/issues/comments{/number}","contents_url":"https://api.github.com/repos/csc3092015/csc309a3/contents/{+path}","compare_url":"https://api.github.com/repos/csc3092015/csc309a3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/csc3092015/csc309a3/merges","archive_url":"https://api.github.com/repos/csc3092015/csc309a3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/csc3092015/csc309a3/downloads","issues_url":"https://api.github.com/repos/csc3092015/csc309a3/issues{/number}","pulls_url":"https://api.github.com/repos/csc3092015/csc309a3/pulls{/number}","milestones_url":"https://api.github.com/repos/csc3092015/csc309a3/milestones{/number}","notifications_url":"https://api.github.com/repos/csc3092015/csc309a3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/csc3092015/csc309a3/labels{/name}","releases_url":"https://api.github.com/repos/csc3092015/csc309a3/releases{/id}","created_at":"2015-06-26T23:53:24Z","updated_at":"2015-07-16T11:28:11Z","pushed_at":"2015-08-02T18:28:17Z","git_url":"git://github.com/csc3092015/csc309a3.git","ssh_url":"git@github.com:csc3092015/csc309a3.git","clone_url":"https://github.com/csc3092015/csc309a3.git","svn_url":"https://github.com/csc3092015/csc309a3","homepage":null,"size":3736,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":7,"forks":0,"open_issues":7,"watchers":0,"default_branch":"master"}},"base":{"label":"csc3092015:master","ref":"master","sha":"89480c397a83fca3b8cb2e1e2085c4c65dc5c114","user":{"login":"csc3092015","id":12770659,"avatar_url":"https://avatars.githubusercontent.com/u/12770659?v=3","gravatar_id":"","url":"https://api.github.com/users/csc3092015","html_url":"https://github.com/csc3092015","followers_url":"https://api.github.com/users/csc3092015/followers","following_url":"https://api.github.com/users/csc3092015/following{/other_user}","gists_url":"https://api.github.com/users/csc3092015/gists{/gist_id}","starred_url":"https://api.github.com/users/csc3092015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csc3092015/subscriptions","organizations_url":"https://api.github.com/users/csc3092015/orgs","repos_url":"https://api.github.com/users/csc3092015/repos","events_url":"https://api.github.com/users/csc3092015/events{/privacy}","received_events_url":"https://api.github.com/users/csc3092015/received_events","type":"Organization","site_admin":false},"repo":{"id":38139431,"name":"csc309a3","full_name":"csc3092015/csc309a3","owner":{"login":"csc3092015","id":12770659,"avatar_url":"https://avatars.githubusercontent.com/u/12770659?v=3","gravatar_id":"","url":"https://api.github.com/users/csc3092015","html_url":"https://github.com/csc3092015","followers_url":"https://api.github.com/users/csc3092015/followers","following_url":"https://api.github.com/users/csc3092015/following{/other_user}","gists_url":"https://api.github.com/users/csc3092015/gists{/gist_id}","starred_url":"https://api.github.com/users/csc3092015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csc3092015/subscriptions","organizations_url":"https://api.github.com/users/csc3092015/orgs","repos_url":"https://api.github.com/users/csc3092015/repos","events_url":"https://api.github.com/users/csc3092015/events{/privacy}","received_events_url":"https://api.github.com/users/csc3092015/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/csc3092015/csc309a3","description":"","fork":false,"url":"https://api.github.com/repos/csc3092015/csc309a3","forks_url":"https://api.github.com/repos/csc3092015/csc309a3/forks","keys_url":"https://api.github.com/repos/csc3092015/csc309a3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/csc3092015/csc309a3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/csc3092015/csc309a3/teams","hooks_url":"https://api.github.com/repos/csc3092015/csc309a3/hooks","issue_events_url":"https://api.github.com/repos/csc3092015/csc309a3/issues/events{/number}","events_url":"https://api.github.com/repos/csc3092015/csc309a3/events","assignees_url":"https://api.github.com/repos/csc3092015/csc309a3/assignees{/user}","branches_url":"https://api.github.com/repos/csc3092015/csc309a3/branches{/branch}","tags_url":"https://api.github.com/repos/csc3092015/csc309a3/tags","blobs_url":"https://api.github.com/repos/csc3092015/csc309a3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/csc3092015/csc309a3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/csc3092015/csc309a3/git/refs{/sha}","trees_url":"https://api.github.com/repos/csc3092015/csc309a3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/csc3092015/csc309a3/statuses/{sha}","languages_url":"https://api.github.com/repos/csc3092015/csc309a3/languages","stargazers_url":"https://api.github.com/repos/csc3092015/csc309a3/stargazers","contributors_url":"https://api.github.com/repos/csc3092015/csc309a3/contributors","subscribers_url":"https://api.github.com/repos/csc3092015/csc309a3/subscribers","subscription_url":"https://api.github.com/repos/csc3092015/csc309a3/subscription","commits_url":"https://api.github.com/repos/csc3092015/csc309a3/commits{/sha}","git_commits_url":"https://api.github.com/repos/csc3092015/csc309a3/git/commits{/sha}","comments_url":"https://api.github.com/repos/csc3092015/csc309a3/comments{/number}","issue_comment_url":"https://api.github.com/repos/csc3092015/csc309a3/issues/comments{/number}","contents_url":"https://api.github.com/repos/csc3092015/csc309a3/contents/{+path}","compare_url":"https://api.github.com/repos/csc3092015/csc309a3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/csc3092015/csc309a3/merges","archive_url":"https://api.github.com/repos/csc3092015/csc309a3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/csc3092015/csc309a3/downloads","issues_url":"https://api.github.com/repos/csc3092015/csc309a3/issues{/number}","pulls_url":"https://api.github.com/repos/csc3092015/csc309a3/pulls{/number}","milestones_url":"https://api.github.com/repos/csc3092015/csc309a3/milestones{/number}","notifications_url":"https://api.github.com/repos/csc3092015/csc309a3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/csc3092015/csc309a3/labels{/name}","releases_url":"https://api.github.com/repos/csc3092015/csc309a3/releases{/id}","created_at":"2015-06-26T23:53:24Z","updated_at":"2015-07-16T11:28:11Z","pushed_at":"2015-08-02T18:28:17Z","git_url":"git://github.com/csc3092015/csc309a3.git","ssh_url":"git@github.com:csc3092015/csc309a3.git","clone_url":"https://github.com/csc3092015/csc309a3.git","svn_url":"https://github.com/csc3092015/csc309a3","homepage":null,"size":3736,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":7,"forks":0,"open_issues":7,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/csc3092015/csc309a3/pulls/40"},"html":{"href":"https://github.com/csc3092015/csc309a3/pull/40"},"issue":{"href":"https://api.github.com/repos/csc3092015/csc309a3/issues/40"},"comments":{"href":"https://api.github.com/repos/csc3092015/csc309a3/issues/40/comments"},"review_comments":{"href":"https://api.github.com/repos/csc3092015/csc309a3/pulls/40/comments"},"review_comment":{"href":"https://api.github.com/repos/csc3092015/csc309a3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/csc3092015/csc309a3/pulls/40/commits"},"statuses":{"href":"https://api.github.com/repos/csc3092015/csc309a3/statuses/92d24cb4f2f2872141fe1e38340721ea7f205ae4"}}}}