{"action":"created","comment":{"url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/pulls/comments/185914021","pull_request_review_id":117401788,"id":185914021,"diff_hunk":"@@ -0,0 +1,78 @@\n+'use strict';\n+\n+var app = app || {};\n+\n+const ENV = {};\n+//token: 1234\n+\n+ENV.isProduction = window.location.protocol === 'https:';\n+// ENV.productionApiUrl = '';\n+ENV.developmentApiUrl = 'http://localhost:3000';\n+ENV.apiUrl = ENV.isProduction ? ENV.productionApiUrl : ENV.developmentApiUrl;\n+\n+(function(module) {\n+  function errorCallback(err) {\n+    console.error(err);\n+    module.errorView.initErrorPage(err);\n+  }\n+\n+  function Book(rawBookObj) {\n+    Object.keys(rawBookObj).forEach(key => this[key] = rawBookObj[key]);\n+  }\n+\n+  Book.prototype.toHtml = function() {\n+    let template = Handlebars.compile($('#book-list-template').text());\n+    return template(this);\n+  };\n+\n+  Book.all = [];\n+  Book.loadAll = rows => Book.all = rows.sort((a, b) => b.title - a.title).map(book => new Book(book));\n+  Book.fetchAll = callback =>\n+    $.get(`${ENV.apiUrl}/api/v1/books`)\n+      .then(Book.loadAll)\n+      .then(callback)\n+      .catch(errorCallback);\n+\n+  Book.fetchOne = (ctx, callback) =>\n+    $.get(`${ENV.apiUrl}/api/v1/books/${ctx.params.book_id}`)\n+      .then(results => ctx.book = results[0])\n+      .then(callback)\n+      .catch(errorCallback);\n+\n+  Book.create = book =>\n+    $.post(`${ENV.apiUrl}/api/v1/books`, book)\n+      .then(() => page('/'))\n+      .catch(errorCallback);\n+\n+  Book.update = (book, bookId) =>\n+    $.ajax({\n+      url: `${ENV.apiUrl}/api/v1/books/${bookId}`,\n+      method: 'PUT',\n+      data: book,\n+    })\n+      .then(() => page(`/books/${bookId}`))\n+      .catch(errorCallback);\n+\n+  Book.destroy = id =>\n+    $.ajax({\n+      url: `${ENV.apiUrl}/api/v1/books/${id}`,\n+      method: 'DELETE',\n+    })\n+      .then(() => page('/'))\n+      .catch(errorCallback);\n+\n+  // COMMENT: Where is this method invoked? What is passed in as the 'book' argument when invoked? What callback will be invoked after Book.loadAll is invoked?","path":"madeline-earl-jay/client/scripts/models/book.js","position":64,"original_position":64,"commit_id":"8696caba243c5ecc030e76d67bdfc12e1490fed9","original_commit_id":"8696caba243c5ecc030e76d67bdfc12e1490fed9","user":{"login":"sayanything830","id":15055004,"avatar_url":"https://avatars2.githubusercontent.com/u/15055004?v=4","gravatar_id":"","url":"https://api.github.com/users/sayanything830","html_url":"https://github.com/sayanything830","followers_url":"https://api.github.com/users/sayanything830/followers","following_url":"https://api.github.com/users/sayanything830/following{/other_user}","gists_url":"https://api.github.com/users/sayanything830/gists{/gist_id}","starred_url":"https://api.github.com/users/sayanything830/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sayanything830/subscriptions","organizations_url":"https://api.github.com/users/sayanything830/orgs","repos_url":"https://api.github.com/users/sayanything830/repos","events_url":"https://api.github.com/users/sayanything830/events{/privacy}","received_events_url":"https://api.github.com/users/sayanything830/received_events","type":"User","site_admin":false},"body":"missing response","created_at":"2018-05-03T19:38:37Z","updated_at":"2018-05-03T19:41:39Z","html_url":"https://github.com/codefellows-seattle-301d33/14-rest-apis/pull/4#discussion_r185914021","pull_request_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/pulls/4","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/pulls/comments/185914021"},"html":{"href":"https://github.com/codefellows-seattle-301d33/14-rest-apis/pull/4#discussion_r185914021"},"pull_request":{"href":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/pulls/4","id":184693581,"html_url":"https://github.com/codefellows-seattle-301d33/14-rest-apis/pull/4","diff_url":"https://github.com/codefellows-seattle-301d33/14-rest-apis/pull/4.diff","patch_url":"https://github.com/codefellows-seattle-301d33/14-rest-apis/pull/4.patch","issue_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/issues/4","number":4,"state":"open","locked":false,"title":"Madeline earl jay","user":{"login":"madelinepet","id":36609087,"avatar_url":"https://avatars2.githubusercontent.com/u/36609087?v=4","gravatar_id":"","url":"https://api.github.com/users/madelinepet","html_url":"https://github.com/madelinepet","followers_url":"https://api.github.com/users/madelinepet/followers","following_url":"https://api.github.com/users/madelinepet/following{/other_user}","gists_url":"https://api.github.com/users/madelinepet/gists{/gist_id}","starred_url":"https://api.github.com/users/madelinepet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madelinepet/subscriptions","organizations_url":"https://api.github.com/users/madelinepet/orgs","repos_url":"https://api.github.com/users/madelinepet/repos","events_url":"https://api.github.com/users/madelinepet/events{/privacy}","received_events_url":"https://api.github.com/users/madelinepet/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-04-27T18:23:02Z","updated_at":"2018-05-03T19:41:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7282a7495dddd2f01663ffb22285f685b27d497b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/pulls/4/commits","review_comments_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/pulls/4/comments","review_comment_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/issues/4/comments","statuses_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/statuses/8696caba243c5ecc030e76d67bdfc12e1490fed9","head":{"label":"madelinepet:madeline-earl-jay","ref":"madeline-earl-jay","sha":"8696caba243c5ecc030e76d67bdfc12e1490fed9","user":{"login":"madelinepet","id":36609087,"avatar_url":"https://avatars2.githubusercontent.com/u/36609087?v=4","gravatar_id":"","url":"https://api.github.com/users/madelinepet","html_url":"https://github.com/madelinepet","followers_url":"https://api.github.com/users/madelinepet/followers","following_url":"https://api.github.com/users/madelinepet/following{/other_user}","gists_url":"https://api.github.com/users/madelinepet/gists{/gist_id}","starred_url":"https://api.github.com/users/madelinepet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madelinepet/subscriptions","organizations_url":"https://api.github.com/users/madelinepet/orgs","repos_url":"https://api.github.com/users/madelinepet/repos","events_url":"https://api.github.com/users/madelinepet/events{/privacy}","received_events_url":"https://api.github.com/users/madelinepet/received_events","type":"User","site_admin":false},"repo":{"id":131313599,"name":"14-rest-apis","full_name":"madelinepet/14-rest-apis","owner":{"login":"madelinepet","id":36609087,"avatar_url":"https://avatars2.githubusercontent.com/u/36609087?v=4","gravatar_id":"","url":"https://api.github.com/users/madelinepet","html_url":"https://github.com/madelinepet","followers_url":"https://api.github.com/users/madelinepet/followers","following_url":"https://api.github.com/users/madelinepet/following{/other_user}","gists_url":"https://api.github.com/users/madelinepet/gists{/gist_id}","starred_url":"https://api.github.com/users/madelinepet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madelinepet/subscriptions","organizations_url":"https://api.github.com/users/madelinepet/orgs","repos_url":"https://api.github.com/users/madelinepet/repos","events_url":"https://api.github.com/users/madelinepet/events{/privacy}","received_events_url":"https://api.github.com/users/madelinepet/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/madelinepet/14-rest-apis","description":null,"fork":true,"url":"https://api.github.com/repos/madelinepet/14-rest-apis","forks_url":"https://api.github.com/repos/madelinepet/14-rest-apis/forks","keys_url":"https://api.github.com/repos/madelinepet/14-rest-apis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/madelinepet/14-rest-apis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/madelinepet/14-rest-apis/teams","hooks_url":"https://api.github.com/repos/madelinepet/14-rest-apis/hooks","issue_events_url":"https://api.github.com/repos/madelinepet/14-rest-apis/issues/events{/number}","events_url":"https://api.github.com/repos/madelinepet/14-rest-apis/events","assignees_url":"https://api.github.com/repos/madelinepet/14-rest-apis/assignees{/user}","branches_url":"https://api.github.com/repos/madelinepet/14-rest-apis/branches{/branch}","tags_url":"https://api.github.com/repos/madelinepet/14-rest-apis/tags","blobs_url":"https://api.github.com/repos/madelinepet/14-rest-apis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/madelinepet/14-rest-apis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/madelinepet/14-rest-apis/git/refs{/sha}","trees_url":"https://api.github.com/repos/madelinepet/14-rest-apis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/madelinepet/14-rest-apis/statuses/{sha}","languages_url":"https://api.github.com/repos/madelinepet/14-rest-apis/languages","stargazers_url":"https://api.github.com/repos/madelinepet/14-rest-apis/stargazers","contributors_url":"https://api.github.com/repos/madelinepet/14-rest-apis/contributors","subscribers_url":"https://api.github.com/repos/madelinepet/14-rest-apis/subscribers","subscription_url":"https://api.github.com/repos/madelinepet/14-rest-apis/subscription","commits_url":"https://api.github.com/repos/madelinepet/14-rest-apis/commits{/sha}","git_commits_url":"https://api.github.com/repos/madelinepet/14-rest-apis/git/commits{/sha}","comments_url":"https://api.github.com/repos/madelinepet/14-rest-apis/comments{/number}","issue_comment_url":"https://api.github.com/repos/madelinepet/14-rest-apis/issues/comments{/number}","contents_url":"https://api.github.com/repos/madelinepet/14-rest-apis/contents/{+path}","compare_url":"https://api.github.com/repos/madelinepet/14-rest-apis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/madelinepet/14-rest-apis/merges","archive_url":"https://api.github.com/repos/madelinepet/14-rest-apis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/madelinepet/14-rest-apis/downloads","issues_url":"https://api.github.com/repos/madelinepet/14-rest-apis/issues{/number}","pulls_url":"https://api.github.com/repos/madelinepet/14-rest-apis/pulls{/number}","milestones_url":"https://api.github.com/repos/madelinepet/14-rest-apis/milestones{/number}","notifications_url":"https://api.github.com/repos/madelinepet/14-rest-apis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/madelinepet/14-rest-apis/labels{/name}","releases_url":"https://api.github.com/repos/madelinepet/14-rest-apis/releases{/id}","deployments_url":"https://api.github.com/repos/madelinepet/14-rest-apis/deployments","created_at":"2018-04-27T15:23:57Z","updated_at":"2018-04-27T19:30:55Z","pushed_at":"2018-04-27T19:30:54Z","git_url":"git://github.com/madelinepet/14-rest-apis.git","ssh_url":"git@github.com:madelinepet/14-rest-apis.git","clone_url":"https://github.com/madelinepet/14-rest-apis.git","svn_url":"https://github.com/madelinepet/14-rest-apis","homepage":null,"size":36,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"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":"codefellows-seattle-301d33:master","ref":"master","sha":"320af80b7dab1fbae5f05a81bcf0ee919fc953ab","user":{"login":"codefellows-seattle-301d33","id":38111355,"avatar_url":"https://avatars0.githubusercontent.com/u/38111355?v=4","gravatar_id":"","url":"https://api.github.com/users/codefellows-seattle-301d33","html_url":"https://github.com/codefellows-seattle-301d33","followers_url":"https://api.github.com/users/codefellows-seattle-301d33/followers","following_url":"https://api.github.com/users/codefellows-seattle-301d33/following{/other_user}","gists_url":"https://api.github.com/users/codefellows-seattle-301d33/gists{/gist_id}","starred_url":"https://api.github.com/users/codefellows-seattle-301d33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codefellows-seattle-301d33/subscriptions","organizations_url":"https://api.github.com/users/codefellows-seattle-301d33/orgs","repos_url":"https://api.github.com/users/codefellows-seattle-301d33/repos","events_url":"https://api.github.com/users/codefellows-seattle-301d33/events{/privacy}","received_events_url":"https://api.github.com/users/codefellows-seattle-301d33/received_events","type":"Organization","site_admin":false},"repo":{"id":128266269,"name":"14-rest-apis","full_name":"codefellows-seattle-301d33/14-rest-apis","owner":{"login":"codefellows-seattle-301d33","id":38111355,"avatar_url":"https://avatars0.githubusercontent.com/u/38111355?v=4","gravatar_id":"","url":"https://api.github.com/users/codefellows-seattle-301d33","html_url":"https://github.com/codefellows-seattle-301d33","followers_url":"https://api.github.com/users/codefellows-seattle-301d33/followers","following_url":"https://api.github.com/users/codefellows-seattle-301d33/following{/other_user}","gists_url":"https://api.github.com/users/codefellows-seattle-301d33/gists{/gist_id}","starred_url":"https://api.github.com/users/codefellows-seattle-301d33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codefellows-seattle-301d33/subscriptions","organizations_url":"https://api.github.com/users/codefellows-seattle-301d33/orgs","repos_url":"https://api.github.com/users/codefellows-seattle-301d33/repos","events_url":"https://api.github.com/users/codefellows-seattle-301d33/events{/privacy}","received_events_url":"https://api.github.com/users/codefellows-seattle-301d33/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codefellows-seattle-301d33/14-rest-apis","description":null,"fork":false,"url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis","forks_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/forks","keys_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/teams","hooks_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/hooks","issue_events_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/issues/events{/number}","events_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/events","assignees_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/assignees{/user}","branches_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/branches{/branch}","tags_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/tags","blobs_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/git/refs{/sha}","trees_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/statuses/{sha}","languages_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/languages","stargazers_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/stargazers","contributors_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/contributors","subscribers_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/subscribers","subscription_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/subscription","commits_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/commits{/sha}","git_commits_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/git/commits{/sha}","comments_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/comments{/number}","issue_comment_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/issues/comments{/number}","contents_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/contents/{+path}","compare_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/merges","archive_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/downloads","issues_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/issues{/number}","pulls_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/pulls{/number}","milestones_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/milestones{/number}","notifications_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/labels{/name}","releases_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/releases{/id}","deployments_url":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/deployments","created_at":"2018-04-05T21:28:04Z","updated_at":"2018-04-27T14:31:10Z","pushed_at":"2018-04-27T23:42:19Z","git_url":"git://github.com/codefellows-seattle-301d33/14-rest-apis.git","ssh_url":"git@github.com:codefellows-seattle-301d33/14-rest-apis.git","clone_url":"https://github.com/codefellows-seattle-301d33/14-rest-apis.git","svn_url":"https://github.com/codefellows-seattle-301d33/14-rest-apis","homepage":null,"size":24,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"archived":false,"open_issues_count":14,"license":null,"forks":15,"open_issues":14,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/pulls/4"},"html":{"href":"https://github.com/codefellows-seattle-301d33/14-rest-apis/pull/4"},"issue":{"href":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/issues/4"},"comments":{"href":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/codefellows-seattle-301d33/14-rest-apis/statuses/8696caba243c5ecc030e76d67bdfc12e1490fed9"}},"author_association":"NONE"}}
{"actor":{"display_login":"sayanything830"}}