{"action":"created","comment":{"url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/pulls/comments/85796688","pull_request_review_id":6491217,"id":85796688,"diff_hunk":"@@ -0,0 +1,68 @@\n+const sander = require('sander');\n+const dir = './data_store';\n+\n+const dataStore = {};\n+\n+dataStore.getData = (id) => {\n+    console.log('getData', id)\n+    return sander.readFile(dir, id, {encoding: 'utf-8'})\n+    .then((data) => {\n+        return JSON.parse(data);\n+    }) ;\n+};\n+\n+dataStore.getAll = () => {\n+    return sander.readdir(dir);\n+};\n+","path":"lib/dataStore.js","position":17,"original_position":17,"commit_id":"47688e25faf39c33ab7f7deb8f5add65e2ff1e46","original_commit_id":"47688e25faf39c33ab7f7deb8f5add65e2ff1e46","user":{"login":"aaronbini","id":10383406,"avatar_url":"https://avatars.githubusercontent.com/u/10383406?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronbini","html_url":"https://github.com/aaronbini","followers_url":"https://api.github.com/users/aaronbini/followers","following_url":"https://api.github.com/users/aaronbini/following{/other_user}","gists_url":"https://api.github.com/users/aaronbini/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronbini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronbini/subscriptions","organizations_url":"https://api.github.com/users/aaronbini/orgs","repos_url":"https://api.github.com/users/aaronbini/repos","events_url":"https://api.github.com/users/aaronbini/events{/privacy}","received_events_url":"https://api.github.com/users/aaronbini/received_events","type":"User","site_admin":false},"body":"maybe a getCount method would be useful here?\r\n```\r\ndataStore.getCount = (dir) => {\r\n  return sander.readdir(dir)\r\n    .then(dirArr => {\r\n      return dirArr.length;\r\n    });\r\n};","created_at":"2016-10-31T18:02:37Z","updated_at":"2016-10-31T18:07:21Z","html_url":"https://github.com/codefellows-portland-javascript-401d4/http-single-resource/pull/26#discussion_r85796688","pull_request_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/pulls/26","_links":{"self":{"href":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/pulls/comments/85796688"},"html":{"href":"https://github.com/codefellows-portland-javascript-401d4/http-single-resource/pull/26#discussion_r85796688"},"pull_request":{"href":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/pulls/26","id":91566707,"html_url":"https://github.com/codefellows-portland-javascript-401d4/http-single-resource/pull/26","diff_url":"https://github.com/codefellows-portland-javascript-401d4/http-single-resource/pull/26.diff","patch_url":"https://github.com/codefellows-portland-javascript-401d4/http-single-resource/pull/26.patch","issue_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/issues/26","number":26,"state":"open","locked":false,"title":"Delete func","user":{"login":"hpats67","id":19363608,"avatar_url":"https://avatars.githubusercontent.com/u/19363608?v=3","gravatar_id":"","url":"https://api.github.com/users/hpats67","html_url":"https://github.com/hpats67","followers_url":"https://api.github.com/users/hpats67/followers","following_url":"https://api.github.com/users/hpats67/following{/other_user}","gists_url":"https://api.github.com/users/hpats67/gists{/gist_id}","starred_url":"https://api.github.com/users/hpats67/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpats67/subscriptions","organizations_url":"https://api.github.com/users/hpats67/orgs","repos_url":"https://api.github.com/users/hpats67/repos","events_url":"https://api.github.com/users/hpats67/events{/privacy}","received_events_url":"https://api.github.com/users/hpats67/received_events","type":"User","site_admin":false},"body":"This took me a better part of a day to get started and the functionality to work. I had a problem with a map/forEach not getting out of things, and then I read about Promise.all which was very helpful. After getting that to work, things dropped in line and I was able to get the rest of the REST calls to work. \r\n\r\nNo testing yet but I understand promises and the calls extremely well now. Will go back and do more. \r\n\r\nI also feel that I took what was needed and added to it already. When POSTing something new, the function will create the name and identifier for you, and keep adding to it, sequentially, no matter how many is added. You can select more than just 1 file to display multiple objects by just separating the queries with a ',' i.e. - mainchar/1,2,3. I also added the ability to update just 1 or multiple lines in the put function. Maybe that was the entirety of the assignment, but from what I read, I thought it might be more basic than that, and I'm just proud of getting it done ;). ","created_at":"2016-10-31T07:29:26Z","updated_at":"2016-10-31T18:31:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e30edb4d9fafc63631624741267af2a47c7f6de6","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/pulls/26/commits","review_comments_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/pulls/26/comments","review_comment_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/issues/26/comments","statuses_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/statuses/47688e25faf39c33ab7f7deb8f5add65e2ff1e46","head":{"label":"hpats67:deleteFunc","ref":"deleteFunc","sha":"47688e25faf39c33ab7f7deb8f5add65e2ff1e46","user":{"login":"hpats67","id":19363608,"avatar_url":"https://avatars.githubusercontent.com/u/19363608?v=3","gravatar_id":"","url":"https://api.github.com/users/hpats67","html_url":"https://github.com/hpats67","followers_url":"https://api.github.com/users/hpats67/followers","following_url":"https://api.github.com/users/hpats67/following{/other_user}","gists_url":"https://api.github.com/users/hpats67/gists{/gist_id}","starred_url":"https://api.github.com/users/hpats67/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpats67/subscriptions","organizations_url":"https://api.github.com/users/hpats67/orgs","repos_url":"https://api.github.com/users/hpats67/repos","events_url":"https://api.github.com/users/hpats67/events{/privacy}","received_events_url":"https://api.github.com/users/hpats67/received_events","type":"User","site_admin":false},"repo":{"id":72175885,"name":"http-single-resource","full_name":"hpats67/http-single-resource","owner":{"login":"hpats67","id":19363608,"avatar_url":"https://avatars.githubusercontent.com/u/19363608?v=3","gravatar_id":"","url":"https://api.github.com/users/hpats67","html_url":"https://github.com/hpats67","followers_url":"https://api.github.com/users/hpats67/followers","following_url":"https://api.github.com/users/hpats67/following{/other_user}","gists_url":"https://api.github.com/users/hpats67/gists{/gist_id}","starred_url":"https://api.github.com/users/hpats67/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpats67/subscriptions","organizations_url":"https://api.github.com/users/hpats67/orgs","repos_url":"https://api.github.com/users/hpats67/repos","events_url":"https://api.github.com/users/hpats67/events{/privacy}","received_events_url":"https://api.github.com/users/hpats67/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hpats67/http-single-resource","description":null,"fork":true,"url":"https://api.github.com/repos/hpats67/http-single-resource","forks_url":"https://api.github.com/repos/hpats67/http-single-resource/forks","keys_url":"https://api.github.com/repos/hpats67/http-single-resource/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hpats67/http-single-resource/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hpats67/http-single-resource/teams","hooks_url":"https://api.github.com/repos/hpats67/http-single-resource/hooks","issue_events_url":"https://api.github.com/repos/hpats67/http-single-resource/issues/events{/number}","events_url":"https://api.github.com/repos/hpats67/http-single-resource/events","assignees_url":"https://api.github.com/repos/hpats67/http-single-resource/assignees{/user}","branches_url":"https://api.github.com/repos/hpats67/http-single-resource/branches{/branch}","tags_url":"https://api.github.com/repos/hpats67/http-single-resource/tags","blobs_url":"https://api.github.com/repos/hpats67/http-single-resource/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hpats67/http-single-resource/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hpats67/http-single-resource/git/refs{/sha}","trees_url":"https://api.github.com/repos/hpats67/http-single-resource/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hpats67/http-single-resource/statuses/{sha}","languages_url":"https://api.github.com/repos/hpats67/http-single-resource/languages","stargazers_url":"https://api.github.com/repos/hpats67/http-single-resource/stargazers","contributors_url":"https://api.github.com/repos/hpats67/http-single-resource/contributors","subscribers_url":"https://api.github.com/repos/hpats67/http-single-resource/subscribers","subscription_url":"https://api.github.com/repos/hpats67/http-single-resource/subscription","commits_url":"https://api.github.com/repos/hpats67/http-single-resource/commits{/sha}","git_commits_url":"https://api.github.com/repos/hpats67/http-single-resource/git/commits{/sha}","comments_url":"https://api.github.com/repos/hpats67/http-single-resource/comments{/number}","issue_comment_url":"https://api.github.com/repos/hpats67/http-single-resource/issues/comments{/number}","contents_url":"https://api.github.com/repos/hpats67/http-single-resource/contents/{+path}","compare_url":"https://api.github.com/repos/hpats67/http-single-resource/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hpats67/http-single-resource/merges","archive_url":"https://api.github.com/repos/hpats67/http-single-resource/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hpats67/http-single-resource/downloads","issues_url":"https://api.github.com/repos/hpats67/http-single-resource/issues{/number}","pulls_url":"https://api.github.com/repos/hpats67/http-single-resource/pulls{/number}","milestones_url":"https://api.github.com/repos/hpats67/http-single-resource/milestones{/number}","notifications_url":"https://api.github.com/repos/hpats67/http-single-resource/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hpats67/http-single-resource/labels{/name}","releases_url":"https://api.github.com/repos/hpats67/http-single-resource/releases{/id}","deployments_url":"https://api.github.com/repos/hpats67/http-single-resource/deployments","created_at":"2016-10-28T05:20:24Z","updated_at":"2016-10-30T22:57:26Z","pushed_at":"2016-10-31T18:22:16Z","git_url":"git://github.com/hpats67/http-single-resource.git","ssh_url":"git@github.com:hpats67/http-single-resource.git","clone_url":"https://github.com/hpats67/http-single-resource.git","svn_url":"https://github.com/hpats67/http-single-resource","homepage":null,"size":13,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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-portland-javascript-401d4:hpats67","ref":"hpats67","sha":"d084cf4d137336bc7f9135a2a588513783faebe1","user":{"login":"codefellows-portland-javascript-401d4","id":22821676,"avatar_url":"https://avatars.githubusercontent.com/u/22821676?v=3","gravatar_id":"","url":"https://api.github.com/users/codefellows-portland-javascript-401d4","html_url":"https://github.com/codefellows-portland-javascript-401d4","followers_url":"https://api.github.com/users/codefellows-portland-javascript-401d4/followers","following_url":"https://api.github.com/users/codefellows-portland-javascript-401d4/following{/other_user}","gists_url":"https://api.github.com/users/codefellows-portland-javascript-401d4/gists{/gist_id}","starred_url":"https://api.github.com/users/codefellows-portland-javascript-401d4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codefellows-portland-javascript-401d4/subscriptions","organizations_url":"https://api.github.com/users/codefellows-portland-javascript-401d4/orgs","repos_url":"https://api.github.com/users/codefellows-portland-javascript-401d4/repos","events_url":"https://api.github.com/users/codefellows-portland-javascript-401d4/events{/privacy}","received_events_url":"https://api.github.com/users/codefellows-portland-javascript-401d4/received_events","type":"Organization","site_admin":false},"repo":{"id":72036037,"name":"http-single-resource","full_name":"codefellows-portland-javascript-401d4/http-single-resource","owner":{"login":"codefellows-portland-javascript-401d4","id":22821676,"avatar_url":"https://avatars.githubusercontent.com/u/22821676?v=3","gravatar_id":"","url":"https://api.github.com/users/codefellows-portland-javascript-401d4","html_url":"https://github.com/codefellows-portland-javascript-401d4","followers_url":"https://api.github.com/users/codefellows-portland-javascript-401d4/followers","following_url":"https://api.github.com/users/codefellows-portland-javascript-401d4/following{/other_user}","gists_url":"https://api.github.com/users/codefellows-portland-javascript-401d4/gists{/gist_id}","starred_url":"https://api.github.com/users/codefellows-portland-javascript-401d4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codefellows-portland-javascript-401d4/subscriptions","organizations_url":"https://api.github.com/users/codefellows-portland-javascript-401d4/orgs","repos_url":"https://api.github.com/users/codefellows-portland-javascript-401d4/repos","events_url":"https://api.github.com/users/codefellows-portland-javascript-401d4/events{/privacy}","received_events_url":"https://api.github.com/users/codefellows-portland-javascript-401d4/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codefellows-portland-javascript-401d4/http-single-resource","description":null,"fork":false,"url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource","forks_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/forks","keys_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/teams","hooks_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/hooks","issue_events_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/issues/events{/number}","events_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/events","assignees_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/assignees{/user}","branches_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/branches{/branch}","tags_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/tags","blobs_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/git/refs{/sha}","trees_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/statuses/{sha}","languages_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/languages","stargazers_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/stargazers","contributors_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/contributors","subscribers_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/subscribers","subscription_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/subscription","commits_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/commits{/sha}","git_commits_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/git/commits{/sha}","comments_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/comments{/number}","issue_comment_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/issues/comments{/number}","contents_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/contents/{+path}","compare_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/merges","archive_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/downloads","issues_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/issues{/number}","pulls_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/pulls{/number}","milestones_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/milestones{/number}","notifications_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/labels{/name}","releases_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/releases{/id}","deployments_url":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/deployments","created_at":"2016-10-26T19:11:37Z","updated_at":"2016-10-26T19:11:37Z","pushed_at":"2016-10-31T18:22:16Z","git_url":"git://github.com/codefellows-portland-javascript-401d4/http-single-resource.git","ssh_url":"git@github.com:codefellows-portland-javascript-401d4/http-single-resource.git","clone_url":"https://github.com/codefellows-portland-javascript-401d4/http-single-resource.git","svn_url":"https://github.com/codefellows-portland-javascript-401d4/http-single-resource","homepage":null,"size":4116,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":24,"forks":21,"open_issues":24,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/pulls/26"},"html":{"href":"https://github.com/codefellows-portland-javascript-401d4/http-single-resource/pull/26"},"issue":{"href":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/issues/26"},"comments":{"href":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/codefellows-portland-javascript-401d4/http-single-resource/statuses/47688e25faf39c33ab7f7deb8f5add65e2ff1e46"}}}}
{"actor":{"display_login":"aaronbini"}}