{"action":"created","comment":{"url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/pulls/comments/71236595","id":71236595,"diff_hunk":"@@ -0,0 +1,67 @@\n+'use strict';\n+\n+const Note = require('../model/note');\n+const AppErr = require('../lib/app-error');\n+const debug = require('debug')('awesomeNote:note-crud');\n+const userCrud = require('./user-crud');\n+\n+exports.createNote = function(reqBody){\n+  debug('note-crud createNote');\n+  return new Promise((resolve, reject) => {\n+    if (! reqBody.content)\n+      return reject(AppErr.error400('note require\\'s content'));\n+    if(! reqBody.name)\n+      return reject(AppErr.error400('note require\\'s name'));\n+\n+    reqBody.timestamp = new Date();\n+    const note = new Note(reqBody);\n+    note.save()\n+    .then(resolve)\n+    .catch(reject);\n+  });\n+};\n+\n+exports.fetchNoteByUserId = function(userId){\n+  debug('note-crud fetchNoteByUserId');\n+  return new Promise((resolve, reject) => {\n+    userCrud.fetchUser({_id: userId})","path":"lab-kyle/lib/note-crud.js","position":27,"original_position":27,"commit_id":"388dc4843a9d3aee795750088c000092146caa6b","original_commit_id":"388dc4843a9d3aee795750088c000092146caa6b","user":{"login":"setheid","id":13786596,"avatar_url":"https://avatars.githubusercontent.com/u/13786596?v=3","gravatar_id":"","url":"https://api.github.com/users/setheid","html_url":"https://github.com/setheid","followers_url":"https://api.github.com/users/setheid/followers","following_url":"https://api.github.com/users/setheid/following{/other_user}","gists_url":"https://api.github.com/users/setheid/gists{/gist_id}","starred_url":"https://api.github.com/users/setheid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/setheid/subscriptions","organizations_url":"https://api.github.com/users/setheid/orgs","repos_url":"https://api.github.com/users/setheid/repos","events_url":"https://api.github.com/users/setheid/events{/privacy}","received_events_url":"https://api.github.com/users/setheid/received_events","type":"User","site_admin":false},"body":"Not sure what you're doing here. Looks like you are looking up the user to by their id to get their id to use in finding an array of notes. Just use their id to look up the notes. And for consistency, do what you did above:\r\n\r\n.then(resolve).catch(reject);\r\n","created_at":"2016-07-18T21:45:36Z","updated_at":"2016-07-18T21:45:36Z","html_url":"https://github.com/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/pull/12#discussion_r71236595","pull_request_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/pulls/comments/71236595"},"html":{"href":"https://github.com/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/pull/12#discussion_r71236595"},"pull_request":{"href":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/pulls/12","id":73516057,"html_url":"https://github.com/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/pull/12","diff_url":"https://github.com/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/pull/12.diff","patch_url":"https://github.com/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/pull/12.patch","issue_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/issues/12","number":12,"state":"open","locked":false,"title":"Kyle","user":{"login":"kyleschnirring","id":13476337,"avatar_url":"https://avatars.githubusercontent.com/u/13476337?v=3","gravatar_id":"","url":"https://api.github.com/users/kyleschnirring","html_url":"https://github.com/kyleschnirring","followers_url":"https://api.github.com/users/kyleschnirring/followers","following_url":"https://api.github.com/users/kyleschnirring/following{/other_user}","gists_url":"https://api.github.com/users/kyleschnirring/gists{/gist_id}","starred_url":"https://api.github.com/users/kyleschnirring/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyleschnirring/subscriptions","organizations_url":"https://api.github.com/users/kyleschnirring/orgs","repos_url":"https://api.github.com/users/kyleschnirring/repos","events_url":"https://api.github.com/users/kyleschnirring/events{/privacy}","received_events_url":"https://api.github.com/users/kyleschnirring/received_events","type":"User","site_admin":false},"body":"not quite done but ill resubmit","created_at":"2016-06-13T02:24:59Z","updated_at":"2016-07-18T21:45:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f7cecc6ea34f84887c547fe033fc1f0bb65475ea","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/pulls/12/commits","review_comments_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/pulls/12/comments","review_comment_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/issues/12/comments","statuses_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/statuses/388dc4843a9d3aee795750088c000092146caa6b","head":{"label":"kyleschnirring:kyle","ref":"kyle","sha":"388dc4843a9d3aee795750088c000092146caa6b","user":{"login":"kyleschnirring","id":13476337,"avatar_url":"https://avatars.githubusercontent.com/u/13476337?v=3","gravatar_id":"","url":"https://api.github.com/users/kyleschnirring","html_url":"https://github.com/kyleschnirring","followers_url":"https://api.github.com/users/kyleschnirring/followers","following_url":"https://api.github.com/users/kyleschnirring/following{/other_user}","gists_url":"https://api.github.com/users/kyleschnirring/gists{/gist_id}","starred_url":"https://api.github.com/users/kyleschnirring/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyleschnirring/subscriptions","organizations_url":"https://api.github.com/users/kyleschnirring/orgs","repos_url":"https://api.github.com/users/kyleschnirring/repos","events_url":"https://api.github.com/users/kyleschnirring/events{/privacy}","received_events_url":"https://api.github.com/users/kyleschnirring/received_events","type":"User","site_admin":false},"repo":{"id":60485568,"name":"lab-11-12-mongo-backed-express","full_name":"kyleschnirring/lab-11-12-mongo-backed-express","owner":{"login":"kyleschnirring","id":13476337,"avatar_url":"https://avatars.githubusercontent.com/u/13476337?v=3","gravatar_id":"","url":"https://api.github.com/users/kyleschnirring","html_url":"https://github.com/kyleschnirring","followers_url":"https://api.github.com/users/kyleschnirring/followers","following_url":"https://api.github.com/users/kyleschnirring/following{/other_user}","gists_url":"https://api.github.com/users/kyleschnirring/gists{/gist_id}","starred_url":"https://api.github.com/users/kyleschnirring/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyleschnirring/subscriptions","organizations_url":"https://api.github.com/users/kyleschnirring/orgs","repos_url":"https://api.github.com/users/kyleschnirring/repos","events_url":"https://api.github.com/users/kyleschnirring/events{/privacy}","received_events_url":"https://api.github.com/users/kyleschnirring/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kyleschnirring/lab-11-12-mongo-backed-express","description":"lab-11-12-mongo-backed-express","fork":true,"url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express","forks_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/forks","keys_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/teams","hooks_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/hooks","issue_events_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/issues/events{/number}","events_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/events","assignees_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/assignees{/user}","branches_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/branches{/branch}","tags_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/tags","blobs_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/git/refs{/sha}","trees_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/statuses/{sha}","languages_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/languages","stargazers_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/stargazers","contributors_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/contributors","subscribers_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/subscribers","subscription_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/subscription","commits_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/commits{/sha}","git_commits_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/git/commits{/sha}","comments_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/comments{/number}","issue_comment_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/issues/comments{/number}","contents_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/contents/{+path}","compare_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/merges","archive_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/downloads","issues_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/issues{/number}","pulls_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/pulls{/number}","milestones_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/milestones{/number}","notifications_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/labels{/name}","releases_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/releases{/id}","deployments_url":"https://api.github.com/repos/kyleschnirring/lab-11-12-mongo-backed-express/deployments","created_at":"2016-06-05T23:16:24Z","updated_at":"2016-06-05T23:16:25Z","pushed_at":"2016-06-15T02:54:49Z","git_url":"git://github.com/kyleschnirring/lab-11-12-mongo-backed-express.git","ssh_url":"git@github.com:kyleschnirring/lab-11-12-mongo-backed-express.git","clone_url":"https://github.com/kyleschnirring/lab-11-12-mongo-backed-express.git","svn_url":"https://github.com/kyleschnirring/lab-11-12-mongo-backed-express","homepage":null,"size":22,"stargazers_count":0,"watchers_count":0,"language":"Shell","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":"codefellows-seattle-javascript-401n1:master","ref":"master","sha":"e13902d1a5e1214a62097b0d76ebcd7eb4e0dbd4","user":{"login":"codefellows-seattle-javascript-401n1","id":18649821,"avatar_url":"https://avatars.githubusercontent.com/u/18649821?v=3","gravatar_id":"","url":"https://api.github.com/users/codefellows-seattle-javascript-401n1","html_url":"https://github.com/codefellows-seattle-javascript-401n1","followers_url":"https://api.github.com/users/codefellows-seattle-javascript-401n1/followers","following_url":"https://api.github.com/users/codefellows-seattle-javascript-401n1/following{/other_user}","gists_url":"https://api.github.com/users/codefellows-seattle-javascript-401n1/gists{/gist_id}","starred_url":"https://api.github.com/users/codefellows-seattle-javascript-401n1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codefellows-seattle-javascript-401n1/subscriptions","organizations_url":"https://api.github.com/users/codefellows-seattle-javascript-401n1/orgs","repos_url":"https://api.github.com/users/codefellows-seattle-javascript-401n1/repos","events_url":"https://api.github.com/users/codefellows-seattle-javascript-401n1/events{/privacy}","received_events_url":"https://api.github.com/users/codefellows-seattle-javascript-401n1/received_events","type":"Organization","site_admin":false},"repo":{"id":60224241,"name":"lab-11-12-mongo-backed-express","full_name":"codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express","owner":{"login":"codefellows-seattle-javascript-401n1","id":18649821,"avatar_url":"https://avatars.githubusercontent.com/u/18649821?v=3","gravatar_id":"","url":"https://api.github.com/users/codefellows-seattle-javascript-401n1","html_url":"https://github.com/codefellows-seattle-javascript-401n1","followers_url":"https://api.github.com/users/codefellows-seattle-javascript-401n1/followers","following_url":"https://api.github.com/users/codefellows-seattle-javascript-401n1/following{/other_user}","gists_url":"https://api.github.com/users/codefellows-seattle-javascript-401n1/gists{/gist_id}","starred_url":"https://api.github.com/users/codefellows-seattle-javascript-401n1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codefellows-seattle-javascript-401n1/subscriptions","organizations_url":"https://api.github.com/users/codefellows-seattle-javascript-401n1/orgs","repos_url":"https://api.github.com/users/codefellows-seattle-javascript-401n1/repos","events_url":"https://api.github.com/users/codefellows-seattle-javascript-401n1/events{/privacy}","received_events_url":"https://api.github.com/users/codefellows-seattle-javascript-401n1/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express","description":"lab-11-12-mongo-backed-express","fork":false,"url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express","forks_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/forks","keys_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/teams","hooks_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/hooks","issue_events_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/issues/events{/number}","events_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/events","assignees_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/assignees{/user}","branches_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/branches{/branch}","tags_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/tags","blobs_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/git/refs{/sha}","trees_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/statuses/{sha}","languages_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/languages","stargazers_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/stargazers","contributors_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/contributors","subscribers_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/subscribers","subscription_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/subscription","commits_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/commits{/sha}","git_commits_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/git/commits{/sha}","comments_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/comments{/number}","issue_comment_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/issues/comments{/number}","contents_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/contents/{+path}","compare_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/merges","archive_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/downloads","issues_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/issues{/number}","pulls_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/pulls{/number}","milestones_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/milestones{/number}","notifications_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/labels{/name}","releases_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/releases{/id}","deployments_url":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/deployments","created_at":"2016-06-02T01:56:07Z","updated_at":"2016-06-02T01:57:13Z","pushed_at":"2016-07-08T00:36:07Z","git_url":"git://github.com/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express.git","ssh_url":"git@github.com:codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express.git","clone_url":"https://github.com/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express.git","svn_url":"https://github.com/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express","homepage":null,"size":7,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":15,"forks":13,"open_issues":15,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/pulls/12"},"html":{"href":"https://github.com/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/pull/12"},"issue":{"href":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/issues/12"},"comments":{"href":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/codefellows-seattle-javascript-401n1/lab-11-12-mongo-backed-express/statuses/388dc4843a9d3aee795750088c000092146caa6b"}}}}
{"actor":{"display_login":"setheid"}}