{"action":"created","comment":{"url":"https://api.github.com/repos/meaghanconroy/review-site-project/pulls/comments/122811198","pull_request_review_id":44958718,"id":122811198,"diff_hunk":"@@ -0,0 +1,83 @@\n+import React, {Component} from 'react';\n+import Venue from './Venue';\n+\n+class VenuesList extends Component {\n+  constructor(props){\n+    super(props)\n+    this.state = {\n+      venues: [],\n+      currentPage: 1,\n+      venuesPerPage: 9\n+    }\n+    this.getData = this.getData.bind(this);\n+    this.previousPage = this.previousPage.bind(this);\n+    this.nextPage = this.nextPage.bind(this);\n+  }\n+\n+  previousPage(event) {\n+    let newPage = this.state.currentPage - 1;\n+    this.setState({ currentPage: newPage })\n+  }\n+\n+  nextPage(event) {\n+    let newPage = this.state.currentPage + 1;\n+    this.setState({ currentPage: newPage })\n+  }\n+\n+  getData() {\n+    fetch('http://localhost:3000/api/v1/venues.json')\n+      .then(response => {\n+        if (response.ok) {\n+          return response;\n+        } else {\n+          let errorMessage = `${response.status} ($response.statusText)`,\n+            error = new Error(errorMessage);\n+          throw(error);\n+        }\n+      })\n+      .then(response => response.json())\n+      .then(body => {\n+        this.setState({ venues: body[\"venues\"] })\n+      })\n+      .catch(error => console.error(`Error in fetch ${error.message}`));\n+    }\n+\n+    componentDidMount(){\n+      this.getData();\n+    }\n+\n+  render() {\n+     let indexOfLastVenue = this.state.currentPage * this.state.venuesPerPage;\n+     let indexOfFirstVenue = indexOfLastVenue - this.state.venuesPerPage;\n+\n+     let currentVenues;\n+\n+     if (indexOfFirstVenue < 0 ) {\n+         currentVenues = this.state.venues.slice(0, 10);\n+       } else if (indexOfLastVenue > this.state.venues.length) {\n+         currentVenues = this.state.venues.slice(this.state.venues.length - 10, this.state.venues.length)\n+       } else {\n+         currentVenues = this.state.venues.slice(indexOfFirstVenue, indexOfLastVenue);\n+      }\n+\n+      let newVenues = currentVenues.map((venue, index) => {\n+        return (\n+          <Venue\n+            key={index}\n+            id={index + 1}\n+            name={venue.name}\n+            url={venue.website}\n+            photo={venue.website_url}\n+            location={venue.location}\n+          />","path":"react/src/components/VenuesList.js","position":72,"original_position":72,"commit_id":"517947969729bc6dda1b44e073e2ebc837bd6f28","original_commit_id":"517947969729bc6dda1b44e073e2ebc837bd6f28","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars3.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Unclosed regular expression.<br>Unrecoverable syntax error. (85% scanned).","created_at":"2017-06-19T20:12:03Z","updated_at":"2017-06-19T20:12:03Z","html_url":"https://github.com/meaghanconroy/review-site-project/pull/10#discussion_r122811198","pull_request_url":"https://api.github.com/repos/meaghanconroy/review-site-project/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/meaghanconroy/review-site-project/pulls/comments/122811198"},"html":{"href":"https://github.com/meaghanconroy/review-site-project/pull/10#discussion_r122811198"},"pull_request":{"href":"https://api.github.com/repos/meaghanconroy/review-site-project/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/meaghanconroy/review-site-project/pulls/10","id":126387208,"html_url":"https://github.com/meaghanconroy/review-site-project/pull/10","diff_url":"https://github.com/meaghanconroy/review-site-project/pull/10.diff","patch_url":"https://github.com/meaghanconroy/review-site-project/pull/10.patch","issue_url":"https://api.github.com/repos/meaghanconroy/review-site-project/issues/10","number":10,"state":"open","locked":false,"title":"React showing on index page","user":{"login":"chriscasella","id":24239334,"avatar_url":"https://avatars2.githubusercontent.com/u/24239334?v=3","gravatar_id":"","url":"https://api.github.com/users/chriscasella","html_url":"https://github.com/chriscasella","followers_url":"https://api.github.com/users/chriscasella/followers","following_url":"https://api.github.com/users/chriscasella/following{/other_user}","gists_url":"https://api.github.com/users/chriscasella/gists{/gist_id}","starred_url":"https://api.github.com/users/chriscasella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriscasella/subscriptions","organizations_url":"https://api.github.com/users/chriscasella/orgs","repos_url":"https://api.github.com/users/chriscasella/repos","events_url":"https://api.github.com/users/chriscasella/events{/privacy}","received_events_url":"https://api.github.com/users/chriscasella/received_events","type":"User","site_admin":false},"body":"No pagination yet, that shall be next!","created_at":"2017-06-19T20:11:29Z","updated_at":"2017-06-19T20:12:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e39854fd0005e020e2d3567fbd2f4ecbcfc79c7a","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/meaghanconroy/review-site-project/pulls/10/commits","review_comments_url":"https://api.github.com/repos/meaghanconroy/review-site-project/pulls/10/comments","review_comment_url":"https://api.github.com/repos/meaghanconroy/review-site-project/pulls/comments{/number}","comments_url":"https://api.github.com/repos/meaghanconroy/review-site-project/issues/10/comments","statuses_url":"https://api.github.com/repos/meaghanconroy/review-site-project/statuses/517947969729bc6dda1b44e073e2ebc837bd6f28","head":{"label":"meaghanconroy:react-venues","ref":"react-venues","sha":"517947969729bc6dda1b44e073e2ebc837bd6f28","user":{"login":"meaghanconroy","id":27435595,"avatar_url":"https://avatars3.githubusercontent.com/u/27435595?v=3","gravatar_id":"","url":"https://api.github.com/users/meaghanconroy","html_url":"https://github.com/meaghanconroy","followers_url":"https://api.github.com/users/meaghanconroy/followers","following_url":"https://api.github.com/users/meaghanconroy/following{/other_user}","gists_url":"https://api.github.com/users/meaghanconroy/gists{/gist_id}","starred_url":"https://api.github.com/users/meaghanconroy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meaghanconroy/subscriptions","organizations_url":"https://api.github.com/users/meaghanconroy/orgs","repos_url":"https://api.github.com/users/meaghanconroy/repos","events_url":"https://api.github.com/users/meaghanconroy/events{/privacy}","received_events_url":"https://api.github.com/users/meaghanconroy/received_events","type":"User","site_admin":false},"repo":{"id":94110282,"name":"review-site-project","full_name":"meaghanconroy/review-site-project","owner":{"login":"meaghanconroy","id":27435595,"avatar_url":"https://avatars3.githubusercontent.com/u/27435595?v=3","gravatar_id":"","url":"https://api.github.com/users/meaghanconroy","html_url":"https://github.com/meaghanconroy","followers_url":"https://api.github.com/users/meaghanconroy/followers","following_url":"https://api.github.com/users/meaghanconroy/following{/other_user}","gists_url":"https://api.github.com/users/meaghanconroy/gists{/gist_id}","starred_url":"https://api.github.com/users/meaghanconroy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meaghanconroy/subscriptions","organizations_url":"https://api.github.com/users/meaghanconroy/orgs","repos_url":"https://api.github.com/users/meaghanconroy/repos","events_url":"https://api.github.com/users/meaghanconroy/events{/privacy}","received_events_url":"https://api.github.com/users/meaghanconroy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/meaghanconroy/review-site-project","description":null,"fork":false,"url":"https://api.github.com/repos/meaghanconroy/review-site-project","forks_url":"https://api.github.com/repos/meaghanconroy/review-site-project/forks","keys_url":"https://api.github.com/repos/meaghanconroy/review-site-project/keys{/key_id}","collaborators_url":"https://api.github.com/repos/meaghanconroy/review-site-project/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/meaghanconroy/review-site-project/teams","hooks_url":"https://api.github.com/repos/meaghanconroy/review-site-project/hooks","issue_events_url":"https://api.github.com/repos/meaghanconroy/review-site-project/issues/events{/number}","events_url":"https://api.github.com/repos/meaghanconroy/review-site-project/events","assignees_url":"https://api.github.com/repos/meaghanconroy/review-site-project/assignees{/user}","branches_url":"https://api.github.com/repos/meaghanconroy/review-site-project/branches{/branch}","tags_url":"https://api.github.com/repos/meaghanconroy/review-site-project/tags","blobs_url":"https://api.github.com/repos/meaghanconroy/review-site-project/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/meaghanconroy/review-site-project/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/meaghanconroy/review-site-project/git/refs{/sha}","trees_url":"https://api.github.com/repos/meaghanconroy/review-site-project/git/trees{/sha}","statuses_url":"https://api.github.com/repos/meaghanconroy/review-site-project/statuses/{sha}","languages_url":"https://api.github.com/repos/meaghanconroy/review-site-project/languages","stargazers_url":"https://api.github.com/repos/meaghanconroy/review-site-project/stargazers","contributors_url":"https://api.github.com/repos/meaghanconroy/review-site-project/contributors","subscribers_url":"https://api.github.com/repos/meaghanconroy/review-site-project/subscribers","subscription_url":"https://api.github.com/repos/meaghanconroy/review-site-project/subscription","commits_url":"https://api.github.com/repos/meaghanconroy/review-site-project/commits{/sha}","git_commits_url":"https://api.github.com/repos/meaghanconroy/review-site-project/git/commits{/sha}","comments_url":"https://api.github.com/repos/meaghanconroy/review-site-project/comments{/number}","issue_comment_url":"https://api.github.com/repos/meaghanconroy/review-site-project/issues/comments{/number}","contents_url":"https://api.github.com/repos/meaghanconroy/review-site-project/contents/{+path}","compare_url":"https://api.github.com/repos/meaghanconroy/review-site-project/compare/{base}...{head}","merges_url":"https://api.github.com/repos/meaghanconroy/review-site-project/merges","archive_url":"https://api.github.com/repos/meaghanconroy/review-site-project/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/meaghanconroy/review-site-project/downloads","issues_url":"https://api.github.com/repos/meaghanconroy/review-site-project/issues{/number}","pulls_url":"https://api.github.com/repos/meaghanconroy/review-site-project/pulls{/number}","milestones_url":"https://api.github.com/repos/meaghanconroy/review-site-project/milestones{/number}","notifications_url":"https://api.github.com/repos/meaghanconroy/review-site-project/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/meaghanconroy/review-site-project/labels{/name}","releases_url":"https://api.github.com/repos/meaghanconroy/review-site-project/releases{/id}","deployments_url":"https://api.github.com/repos/meaghanconroy/review-site-project/deployments","created_at":"2017-06-12T15:14:35Z","updated_at":"2017-06-12T15:21:45Z","pushed_at":"2017-06-19T20:11:29Z","git_url":"git://github.com/meaghanconroy/review-site-project.git","ssh_url":"git@github.com:meaghanconroy/review-site-project.git","clone_url":"https://github.com/meaghanconroy/review-site-project.git","svn_url":"https://github.com/meaghanconroy/review-site-project","homepage":null,"size":1481,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"meaghanconroy:master","ref":"master","sha":"115da4234dafec3c3c064874dcb382eda377c9e4","user":{"login":"meaghanconroy","id":27435595,"avatar_url":"https://avatars3.githubusercontent.com/u/27435595?v=3","gravatar_id":"","url":"https://api.github.com/users/meaghanconroy","html_url":"https://github.com/meaghanconroy","followers_url":"https://api.github.com/users/meaghanconroy/followers","following_url":"https://api.github.com/users/meaghanconroy/following{/other_user}","gists_url":"https://api.github.com/users/meaghanconroy/gists{/gist_id}","starred_url":"https://api.github.com/users/meaghanconroy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meaghanconroy/subscriptions","organizations_url":"https://api.github.com/users/meaghanconroy/orgs","repos_url":"https://api.github.com/users/meaghanconroy/repos","events_url":"https://api.github.com/users/meaghanconroy/events{/privacy}","received_events_url":"https://api.github.com/users/meaghanconroy/received_events","type":"User","site_admin":false},"repo":{"id":94110282,"name":"review-site-project","full_name":"meaghanconroy/review-site-project","owner":{"login":"meaghanconroy","id":27435595,"avatar_url":"https://avatars3.githubusercontent.com/u/27435595?v=3","gravatar_id":"","url":"https://api.github.com/users/meaghanconroy","html_url":"https://github.com/meaghanconroy","followers_url":"https://api.github.com/users/meaghanconroy/followers","following_url":"https://api.github.com/users/meaghanconroy/following{/other_user}","gists_url":"https://api.github.com/users/meaghanconroy/gists{/gist_id}","starred_url":"https://api.github.com/users/meaghanconroy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meaghanconroy/subscriptions","organizations_url":"https://api.github.com/users/meaghanconroy/orgs","repos_url":"https://api.github.com/users/meaghanconroy/repos","events_url":"https://api.github.com/users/meaghanconroy/events{/privacy}","received_events_url":"https://api.github.com/users/meaghanconroy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/meaghanconroy/review-site-project","description":null,"fork":false,"url":"https://api.github.com/repos/meaghanconroy/review-site-project","forks_url":"https://api.github.com/repos/meaghanconroy/review-site-project/forks","keys_url":"https://api.github.com/repos/meaghanconroy/review-site-project/keys{/key_id}","collaborators_url":"https://api.github.com/repos/meaghanconroy/review-site-project/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/meaghanconroy/review-site-project/teams","hooks_url":"https://api.github.com/repos/meaghanconroy/review-site-project/hooks","issue_events_url":"https://api.github.com/repos/meaghanconroy/review-site-project/issues/events{/number}","events_url":"https://api.github.com/repos/meaghanconroy/review-site-project/events","assignees_url":"https://api.github.com/repos/meaghanconroy/review-site-project/assignees{/user}","branches_url":"https://api.github.com/repos/meaghanconroy/review-site-project/branches{/branch}","tags_url":"https://api.github.com/repos/meaghanconroy/review-site-project/tags","blobs_url":"https://api.github.com/repos/meaghanconroy/review-site-project/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/meaghanconroy/review-site-project/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/meaghanconroy/review-site-project/git/refs{/sha}","trees_url":"https://api.github.com/repos/meaghanconroy/review-site-project/git/trees{/sha}","statuses_url":"https://api.github.com/repos/meaghanconroy/review-site-project/statuses/{sha}","languages_url":"https://api.github.com/repos/meaghanconroy/review-site-project/languages","stargazers_url":"https://api.github.com/repos/meaghanconroy/review-site-project/stargazers","contributors_url":"https://api.github.com/repos/meaghanconroy/review-site-project/contributors","subscribers_url":"https://api.github.com/repos/meaghanconroy/review-site-project/subscribers","subscription_url":"https://api.github.com/repos/meaghanconroy/review-site-project/subscription","commits_url":"https://api.github.com/repos/meaghanconroy/review-site-project/commits{/sha}","git_commits_url":"https://api.github.com/repos/meaghanconroy/review-site-project/git/commits{/sha}","comments_url":"https://api.github.com/repos/meaghanconroy/review-site-project/comments{/number}","issue_comment_url":"https://api.github.com/repos/meaghanconroy/review-site-project/issues/comments{/number}","contents_url":"https://api.github.com/repos/meaghanconroy/review-site-project/contents/{+path}","compare_url":"https://api.github.com/repos/meaghanconroy/review-site-project/compare/{base}...{head}","merges_url":"https://api.github.com/repos/meaghanconroy/review-site-project/merges","archive_url":"https://api.github.com/repos/meaghanconroy/review-site-project/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/meaghanconroy/review-site-project/downloads","issues_url":"https://api.github.com/repos/meaghanconroy/review-site-project/issues{/number}","pulls_url":"https://api.github.com/repos/meaghanconroy/review-site-project/pulls{/number}","milestones_url":"https://api.github.com/repos/meaghanconroy/review-site-project/milestones{/number}","notifications_url":"https://api.github.com/repos/meaghanconroy/review-site-project/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/meaghanconroy/review-site-project/labels{/name}","releases_url":"https://api.github.com/repos/meaghanconroy/review-site-project/releases{/id}","deployments_url":"https://api.github.com/repos/meaghanconroy/review-site-project/deployments","created_at":"2017-06-12T15:14:35Z","updated_at":"2017-06-12T15:21:45Z","pushed_at":"2017-06-19T20:11:29Z","git_url":"git://github.com/meaghanconroy/review-site-project.git","ssh_url":"git@github.com:meaghanconroy/review-site-project.git","clone_url":"https://github.com/meaghanconroy/review-site-project.git","svn_url":"https://github.com/meaghanconroy/review-site-project","homepage":null,"size":1481,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/meaghanconroy/review-site-project/pulls/10"},"html":{"href":"https://github.com/meaghanconroy/review-site-project/pull/10"},"issue":{"href":"https://api.github.com/repos/meaghanconroy/review-site-project/issues/10"},"comments":{"href":"https://api.github.com/repos/meaghanconroy/review-site-project/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/meaghanconroy/review-site-project/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/meaghanconroy/review-site-project/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/meaghanconroy/review-site-project/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/meaghanconroy/review-site-project/statuses/517947969729bc6dda1b44e073e2ebc837bd6f28"}}}}
{"actor":{"display_login":"houndci-bot"}}