{"action":"created","comment":{"url":"https://api.github.com/repos/HackYourFuture/Node.js/pulls/comments/221232332","pull_request_review_id":159830293,"id":221232332,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMTIzMjMzMg==","diff_hunk":"@@ -0,0 +1,108 @@\n+'use strict';\n+const fs = require('fs');\n+const Joi = require('joi');\n+const toDoFile = 'todolist.json';\n+\n+const readToDoList = () => {\n+  return new Promise((resolve, reject) => {\n+    if (!fs.existsSync(toDoFile)) {\n+      fs.appendFile(toDoFile, '[]');\n+    };\n+    fs.readFile(toDoFile, (err, data) => {\n+      if (err) { return reject(err); };\n+      return resolve(data);\n+    });\n+  });\n+};\n+function writeData(file, data) {\n+  fs.watchFile(file, JSON.stringify(data), (error) => {\n+    if (error) { console.log(error); }\n+  });\n+};\n+const validateTask = (task) => {\n+  const schema = {\n+    id:Joi.number().required(),\n+    description : Joi.string().required(),\n+    done:Joi.boolean().required()\n+  };\n+  return Joi.validate(task, schema);\n+};\n+const appendToDo = async(item, res) => {\n+  const data = await readToDoList();","path":"week3/homework/src/utilities.js","position":31,"original_position":31,"commit_id":"495a83f3337533f7c89f1f3b679978b98fce80bc","original_commit_id":"495a83f3337533f7c89f1f3b679978b98fce80bc","user":{"login":"J05J4","id":1948641,"node_id":"MDQ6VXNlcjE5NDg2NDE=","avatar_url":"https://avatars0.githubusercontent.com/u/1948641?v=4","gravatar_id":"","url":"https://api.github.com/users/J05J4","html_url":"https://github.com/J05J4","followers_url":"https://api.github.com/users/J05J4/followers","following_url":"https://api.github.com/users/J05J4/following{/other_user}","gists_url":"https://api.github.com/users/J05J4/gists{/gist_id}","starred_url":"https://api.github.com/users/J05J4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/J05J4/subscriptions","organizations_url":"https://api.github.com/users/J05J4/orgs","repos_url":"https://api.github.com/users/J05J4/repos","events_url":"https://api.github.com/users/J05J4/events{/privacy}","received_events_url":"https://api.github.com/users/J05J4/received_events","type":"User","site_admin":false},"body":"instead of `await` you can also use `fs.readFileSync` witch runs synchronously. ","created_at":"2018-09-28T12:13:15Z","updated_at":"2018-09-28T12:47:21Z","html_url":"https://github.com/HackYourFuture/Node.js/pull/253#discussion_r221232332","pull_request_url":"https://api.github.com/repos/HackYourFuture/Node.js/pulls/253","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/HackYourFuture/Node.js/pulls/comments/221232332"},"html":{"href":"https://github.com/HackYourFuture/Node.js/pull/253#discussion_r221232332"},"pull_request":{"href":"https://api.github.com/repos/HackYourFuture/Node.js/pulls/253"}}},"pull_request":{"url":"https://api.github.com/repos/HackYourFuture/Node.js/pulls/253","id":217468673,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3NDY4Njcz","html_url":"https://github.com/HackYourFuture/Node.js/pull/253","diff_url":"https://github.com/HackYourFuture/Node.js/pull/253.diff","patch_url":"https://github.com/HackYourFuture/Node.js/pull/253.patch","issue_url":"https://api.github.com/repos/HackYourFuture/Node.js/issues/253","number":253,"state":"open","locked":false,"title":"Week3","user":{"login":"ozgurleo","id":37554614,"node_id":"MDQ6VXNlcjM3NTU0NjE0","avatar_url":"https://avatars1.githubusercontent.com/u/37554614?v=4","gravatar_id":"","url":"https://api.github.com/users/ozgurleo","html_url":"https://github.com/ozgurleo","followers_url":"https://api.github.com/users/ozgurleo/followers","following_url":"https://api.github.com/users/ozgurleo/following{/other_user}","gists_url":"https://api.github.com/users/ozgurleo/gists{/gist_id}","starred_url":"https://api.github.com/users/ozgurleo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ozgurleo/subscriptions","organizations_url":"https://api.github.com/users/ozgurleo/orgs","repos_url":"https://api.github.com/users/ozgurleo/repos","events_url":"https://api.github.com/users/ozgurleo/events{/privacy}","received_events_url":"https://api.github.com/users/ozgurleo/received_events","type":"User","site_admin":false},"body":"I could not achieve the 'markAsNotDone'. After I figure it out. I will recommit the homework shortly.","created_at":"2018-09-22T17:28:47Z","updated_at":"2018-09-28T12:47:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9597b7aa6a3d0302c065930e9b1d32927600a9b1","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1052715631,"node_id":"MDU6TGFiZWwxMDUyNzE1NjMx","url":"https://api.github.com/repos/HackYourFuture/Node.js/labels/class%2016","name":"class 16","color":"0052cc","default":false},{"id":883891913,"node_id":"MDU6TGFiZWw4ODM4OTE5MTM=","url":"https://api.github.com/repos/HackYourFuture/Node.js/labels/homework3","name":"homework3","color":"0bead8","default":false},{"id":862630052,"node_id":"MDU6TGFiZWw4NjI2MzAwNTI=","url":"https://api.github.com/repos/HackYourFuture/Node.js/labels/to%20review","name":"to review","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/HackYourFuture/Node.js/pulls/253/commits","review_comments_url":"https://api.github.com/repos/HackYourFuture/Node.js/pulls/253/comments","review_comment_url":"https://api.github.com/repos/HackYourFuture/Node.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/HackYourFuture/Node.js/issues/253/comments","statuses_url":"https://api.github.com/repos/HackYourFuture/Node.js/statuses/495a83f3337533f7c89f1f3b679978b98fce80bc","head":{"label":"ozgurleo:week3","ref":"week3","sha":"495a83f3337533f7c89f1f3b679978b98fce80bc","user":{"login":"ozgurleo","id":37554614,"node_id":"MDQ6VXNlcjM3NTU0NjE0","avatar_url":"https://avatars1.githubusercontent.com/u/37554614?v=4","gravatar_id":"","url":"https://api.github.com/users/ozgurleo","html_url":"https://github.com/ozgurleo","followers_url":"https://api.github.com/users/ozgurleo/followers","following_url":"https://api.github.com/users/ozgurleo/following{/other_user}","gists_url":"https://api.github.com/users/ozgurleo/gists{/gist_id}","starred_url":"https://api.github.com/users/ozgurleo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ozgurleo/subscriptions","organizations_url":"https://api.github.com/users/ozgurleo/orgs","repos_url":"https://api.github.com/users/ozgurleo/repos","events_url":"https://api.github.com/users/ozgurleo/events{/privacy}","received_events_url":"https://api.github.com/users/ozgurleo/received_events","type":"User","site_admin":false},"repo":{"id":147547938,"node_id":"MDEwOlJlcG9zaXRvcnkxNDc1NDc5Mzg=","name":"Node.js","full_name":"ozgurleo/Node.js","private":false,"owner":{"login":"ozgurleo","id":37554614,"node_id":"MDQ6VXNlcjM3NTU0NjE0","avatar_url":"https://avatars1.githubusercontent.com/u/37554614?v=4","gravatar_id":"","url":"https://api.github.com/users/ozgurleo","html_url":"https://github.com/ozgurleo","followers_url":"https://api.github.com/users/ozgurleo/followers","following_url":"https://api.github.com/users/ozgurleo/following{/other_user}","gists_url":"https://api.github.com/users/ozgurleo/gists{/gist_id}","starred_url":"https://api.github.com/users/ozgurleo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ozgurleo/subscriptions","organizations_url":"https://api.github.com/users/ozgurleo/orgs","repos_url":"https://api.github.com/users/ozgurleo/repos","events_url":"https://api.github.com/users/ozgurleo/events{/privacy}","received_events_url":"https://api.github.com/users/ozgurleo/received_events","type":"User","site_admin":false},"html_url":"https://github.com/ozgurleo/Node.js","description":"HackYourFuture - Node.js","fork":true,"url":"https://api.github.com/repos/ozgurleo/Node.js","forks_url":"https://api.github.com/repos/ozgurleo/Node.js/forks","keys_url":"https://api.github.com/repos/ozgurleo/Node.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ozgurleo/Node.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ozgurleo/Node.js/teams","hooks_url":"https://api.github.com/repos/ozgurleo/Node.js/hooks","issue_events_url":"https://api.github.com/repos/ozgurleo/Node.js/issues/events{/number}","events_url":"https://api.github.com/repos/ozgurleo/Node.js/events","assignees_url":"https://api.github.com/repos/ozgurleo/Node.js/assignees{/user}","branches_url":"https://api.github.com/repos/ozgurleo/Node.js/branches{/branch}","tags_url":"https://api.github.com/repos/ozgurleo/Node.js/tags","blobs_url":"https://api.github.com/repos/ozgurleo/Node.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ozgurleo/Node.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ozgurleo/Node.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/ozgurleo/Node.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ozgurleo/Node.js/statuses/{sha}","languages_url":"https://api.github.com/repos/ozgurleo/Node.js/languages","stargazers_url":"https://api.github.com/repos/ozgurleo/Node.js/stargazers","contributors_url":"https://api.github.com/repos/ozgurleo/Node.js/contributors","subscribers_url":"https://api.github.com/repos/ozgurleo/Node.js/subscribers","subscription_url":"https://api.github.com/repos/ozgurleo/Node.js/subscription","commits_url":"https://api.github.com/repos/ozgurleo/Node.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/ozgurleo/Node.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/ozgurleo/Node.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/ozgurleo/Node.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/ozgurleo/Node.js/contents/{+path}","compare_url":"https://api.github.com/repos/ozgurleo/Node.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ozgurleo/Node.js/merges","archive_url":"https://api.github.com/repos/ozgurleo/Node.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ozgurleo/Node.js/downloads","issues_url":"https://api.github.com/repos/ozgurleo/Node.js/issues{/number}","pulls_url":"https://api.github.com/repos/ozgurleo/Node.js/pulls{/number}","milestones_url":"https://api.github.com/repos/ozgurleo/Node.js/milestones{/number}","notifications_url":"https://api.github.com/repos/ozgurleo/Node.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ozgurleo/Node.js/labels{/name}","releases_url":"https://api.github.com/repos/ozgurleo/Node.js/releases{/id}","deployments_url":"https://api.github.com/repos/ozgurleo/Node.js/deployments","created_at":"2018-09-05T16:27:57Z","updated_at":"2018-09-05T16:27:59Z","pushed_at":"2018-09-25T12:38:52Z","git_url":"git://github.com/ozgurleo/Node.js.git","ssh_url":"git@github.com:ozgurleo/Node.js.git","clone_url":"https://github.com/ozgurleo/Node.js.git","svn_url":"https://github.com/ozgurleo/Node.js","homepage":"","size":705,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"HackYourFuture:master","ref":"master","sha":"948e655329a5085fe693cc3e8e6c4505428dfd19","user":{"login":"HackYourFuture","id":20858568,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwODU4NTY4","avatar_url":"https://avatars2.githubusercontent.com/u/20858568?v=4","gravatar_id":"","url":"https://api.github.com/users/HackYourFuture","html_url":"https://github.com/HackYourFuture","followers_url":"https://api.github.com/users/HackYourFuture/followers","following_url":"https://api.github.com/users/HackYourFuture/following{/other_user}","gists_url":"https://api.github.com/users/HackYourFuture/gists{/gist_id}","starred_url":"https://api.github.com/users/HackYourFuture/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HackYourFuture/subscriptions","organizations_url":"https://api.github.com/users/HackYourFuture/orgs","repos_url":"https://api.github.com/users/HackYourFuture/repos","events_url":"https://api.github.com/users/HackYourFuture/events{/privacy}","received_events_url":"https://api.github.com/users/HackYourFuture/received_events","type":"Organization","site_admin":false},"repo":{"id":68906713,"node_id":"MDEwOlJlcG9zaXRvcnk2ODkwNjcxMw==","name":"Node.js","full_name":"HackYourFuture/Node.js","private":false,"owner":{"login":"HackYourFuture","id":20858568,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwODU4NTY4","avatar_url":"https://avatars2.githubusercontent.com/u/20858568?v=4","gravatar_id":"","url":"https://api.github.com/users/HackYourFuture","html_url":"https://github.com/HackYourFuture","followers_url":"https://api.github.com/users/HackYourFuture/followers","following_url":"https://api.github.com/users/HackYourFuture/following{/other_user}","gists_url":"https://api.github.com/users/HackYourFuture/gists{/gist_id}","starred_url":"https://api.github.com/users/HackYourFuture/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HackYourFuture/subscriptions","organizations_url":"https://api.github.com/users/HackYourFuture/orgs","repos_url":"https://api.github.com/users/HackYourFuture/repos","events_url":"https://api.github.com/users/HackYourFuture/events{/privacy}","received_events_url":"https://api.github.com/users/HackYourFuture/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/HackYourFuture/Node.js","description":"HackYourFuture - Node.js","fork":false,"url":"https://api.github.com/repos/HackYourFuture/Node.js","forks_url":"https://api.github.com/repos/HackYourFuture/Node.js/forks","keys_url":"https://api.github.com/repos/HackYourFuture/Node.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HackYourFuture/Node.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HackYourFuture/Node.js/teams","hooks_url":"https://api.github.com/repos/HackYourFuture/Node.js/hooks","issue_events_url":"https://api.github.com/repos/HackYourFuture/Node.js/issues/events{/number}","events_url":"https://api.github.com/repos/HackYourFuture/Node.js/events","assignees_url":"https://api.github.com/repos/HackYourFuture/Node.js/assignees{/user}","branches_url":"https://api.github.com/repos/HackYourFuture/Node.js/branches{/branch}","tags_url":"https://api.github.com/repos/HackYourFuture/Node.js/tags","blobs_url":"https://api.github.com/repos/HackYourFuture/Node.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HackYourFuture/Node.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HackYourFuture/Node.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/HackYourFuture/Node.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HackYourFuture/Node.js/statuses/{sha}","languages_url":"https://api.github.com/repos/HackYourFuture/Node.js/languages","stargazers_url":"https://api.github.com/repos/HackYourFuture/Node.js/stargazers","contributors_url":"https://api.github.com/repos/HackYourFuture/Node.js/contributors","subscribers_url":"https://api.github.com/repos/HackYourFuture/Node.js/subscribers","subscription_url":"https://api.github.com/repos/HackYourFuture/Node.js/subscription","commits_url":"https://api.github.com/repos/HackYourFuture/Node.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/HackYourFuture/Node.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/HackYourFuture/Node.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/HackYourFuture/Node.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/HackYourFuture/Node.js/contents/{+path}","compare_url":"https://api.github.com/repos/HackYourFuture/Node.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HackYourFuture/Node.js/merges","archive_url":"https://api.github.com/repos/HackYourFuture/Node.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HackYourFuture/Node.js/downloads","issues_url":"https://api.github.com/repos/HackYourFuture/Node.js/issues{/number}","pulls_url":"https://api.github.com/repos/HackYourFuture/Node.js/pulls{/number}","milestones_url":"https://api.github.com/repos/HackYourFuture/Node.js/milestones{/number}","notifications_url":"https://api.github.com/repos/HackYourFuture/Node.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HackYourFuture/Node.js/labels{/name}","releases_url":"https://api.github.com/repos/HackYourFuture/Node.js/releases{/id}","deployments_url":"https://api.github.com/repos/HackYourFuture/Node.js/deployments","created_at":"2016-09-22T09:36:44Z","updated_at":"2018-06-22T10:15:58Z","pushed_at":"2018-09-25T16:05:19Z","git_url":"git://github.com/HackYourFuture/Node.js.git","ssh_url":"git@github.com:HackYourFuture/Node.js.git","clone_url":"https://github.com/HackYourFuture/Node.js.git","svn_url":"https://github.com/HackYourFuture/Node.js","homepage":"","size":695,"stargazers_count":26,"watchers_count":26,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":135,"mirror_url":null,"archived":false,"open_issues_count":42,"license":null,"forks":135,"open_issues":42,"watchers":26,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/HackYourFuture/Node.js/pulls/253"},"html":{"href":"https://github.com/HackYourFuture/Node.js/pull/253"},"issue":{"href":"https://api.github.com/repos/HackYourFuture/Node.js/issues/253"},"comments":{"href":"https://api.github.com/repos/HackYourFuture/Node.js/issues/253/comments"},"review_comments":{"href":"https://api.github.com/repos/HackYourFuture/Node.js/pulls/253/comments"},"review_comment":{"href":"https://api.github.com/repos/HackYourFuture/Node.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/HackYourFuture/Node.js/pulls/253/commits"},"statuses":{"href":"https://api.github.com/repos/HackYourFuture/Node.js/statuses/495a83f3337533f7c89f1f3b679978b98fce80bc"}},"author_association":"NONE"}}
{"actor":{"display_login":"J05J4"}}