{"action":"created","comment":{"url":"https://api.github.com/repos/JulkaIII/todo-app-react/pulls/comments/176797179","pull_request_review_id":106569568,"id":176797179,"diff_hunk":"@@ -1,41 +1,179 @@\n /* eslint-disable import/no-named-as-default */\n-import React from 'react';\n-import PropTypes from 'prop-types';\n-import { Switch, NavLink, Route } from 'react-router-dom';\n-import HomePage from './HomePage';\n-import FuelSavingsPage from './containers/FuelSavingsPage';\n-import AboutPage from './AboutPage';\n-import NotFoundPage from './NotFoundPage';\n+import React from \"react\";\n+import PropTypes from \"prop-types\";\n+import MuiThemeProvider from \"material-ui/styles/MuiThemeProvider\";\n+import Paper from \"material-ui/Paper\";\n+import AddTodo from \"./AddTodo\";\n+import TodoList from \"./TodoList\";\n+import swal from \"sweetalert\";\n \n // This is a class-based component because the current\n // version of hot reloading won't hot reload a stateless\n // component at the top-level.\n \n class App extends React.Component {\n+  constructor(props) {\n+    super(props);\n+    this.state = {\n+      listItems: []\n+    };\n+    this.removeItem = this.removeItem.bind(this);\n+    this.addItem = this.addItem.bind(this);\n+    this.updateItem = this.updateItem.bind(this);\n+  }\n+\n+  componentDidMount() {\n+    let self = this;\n+    let listItems = [];\n+    let getUrl =\n+      \"https://api.backendless.com/DCEDF76D-9662-324E-FF07-3C8BF4BBE100/F1870599-8446-F184-FFF4-DB8A4B81F800/services/TodoItemsService/todo-items\";\n+    fetch(getUrl)\n+      .then(response => {\n+        if (response.ok) {\n+          return response.json();\n+        } else {\n+          return Promise.reject(response.statusText);\n+        }\n+      })\n+      .then(json => {\n+        listItems = json;\n+        self.setState({\n+          listItems: listItems\n+        });\n+      })\n+      .catch(error => swal(\"Something went wrong...\", error, \"error\"));\n+  }\n+\n+  removeItem(id) {\n+    let deleteUrl =\n+      \"https://api.backendless.com/DCEDF76D-9662-324E-FF07-3C8BF4BBE100/F1870599-8446-F184-FFF4-DB8A4B81F800/services/TodoItemsService/todo-items\";\n+    let self = this;\n+\n+    fetch(deleteUrl, {\n+      method: \"DELETE\",\n+      headers: {\n+        \"Content-Type\": \"application/json\"\n+      },\n+      body: id\n+    }).then(response => {\n+      if (response.ok) {\n+        let newListItems = self.state.listItems.filter(item => {\n+          if (item.objectId !== id) {\n+            return item;\n+          }\n+        });\n+        self.setState({\n+          listItems: newListItems\n+        });\n+      } else {\n+        swal(\"Something went wrong...\", response.statusText, \"error\");\n+      }\n+    });\n+  }\n+\n+  addItem(formData) {\n+    let postUrl =\n+      \"https://api.backendless.com/DCEDF76D-9662-324E-FF07-3C8BF4BBE100/F1870599-8446-F184-FFF4-DB8A4B81F800/services/TodoItemsService/list-items\";\n+\n+    let self = this;\n+\n+    fetch(postUrl, {","path":"src/components/App.js","position":87,"original_position":87,"commit_id":"1c9c242b2af29c0e3980768691c5af9a8af0a87f","original_commit_id":"1c9c242b2af29c0e3980768691c5af9a8af0a87f","user":{"login":"yuriimelnyk","id":13552717,"avatar_url":"https://avatars3.githubusercontent.com/u/13552717?v=4","gravatar_id":"","url":"https://api.github.com/users/yuriimelnyk","html_url":"https://github.com/yuriimelnyk","followers_url":"https://api.github.com/users/yuriimelnyk/followers","following_url":"https://api.github.com/users/yuriimelnyk/following{/other_user}","gists_url":"https://api.github.com/users/yuriimelnyk/gists{/gist_id}","starred_url":"https://api.github.com/users/yuriimelnyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuriimelnyk/subscriptions","organizations_url":"https://api.github.com/users/yuriimelnyk/orgs","repos_url":"https://api.github.com/users/yuriimelnyk/repos","events_url":"https://api.github.com/users/yuriimelnyk/events{/privacy}","received_events_url":"https://api.github.com/users/yuriimelnyk/received_events","type":"User","site_admin":false},"body":"Винеси в окремий апі сервіс","created_at":"2018-03-23T16:48:30Z","updated_at":"2018-03-23T16:48:30Z","html_url":"https://github.com/JulkaIII/todo-app-react/pull/1#discussion_r176797179","pull_request_url":"https://api.github.com/repos/JulkaIII/todo-app-react/pulls/1","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/JulkaIII/todo-app-react/pulls/comments/176797179"},"html":{"href":"https://github.com/JulkaIII/todo-app-react/pull/1#discussion_r176797179"},"pull_request":{"href":"https://api.github.com/repos/JulkaIII/todo-app-react/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/JulkaIII/todo-app-react/pulls/1","id":175373740,"html_url":"https://github.com/JulkaIII/todo-app-react/pull/1","diff_url":"https://github.com/JulkaIII/todo-app-react/pull/1.diff","patch_url":"https://github.com/JulkaIII/todo-app-react/pull/1.patch","issue_url":"https://api.github.com/repos/JulkaIII/todo-app-react/issues/1","number":1,"state":"open","locked":false,"title":"Added functionality","user":{"login":"JulkaIII","id":22578645,"avatar_url":"https://avatars2.githubusercontent.com/u/22578645?v=4","gravatar_id":"","url":"https://api.github.com/users/JulkaIII","html_url":"https://github.com/JulkaIII","followers_url":"https://api.github.com/users/JulkaIII/followers","following_url":"https://api.github.com/users/JulkaIII/following{/other_user}","gists_url":"https://api.github.com/users/JulkaIII/gists{/gist_id}","starred_url":"https://api.github.com/users/JulkaIII/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JulkaIII/subscriptions","organizations_url":"https://api.github.com/users/JulkaIII/orgs","repos_url":"https://api.github.com/users/JulkaIII/repos","events_url":"https://api.github.com/users/JulkaIII/events{/privacy}","received_events_url":"https://api.github.com/users/JulkaIII/received_events","type":"User","site_admin":false},"body":"\r\n","created_at":"2018-03-15T20:44:56Z","updated_at":"2018-03-23T16:48:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"62c55028c15ee14b24fba27dda58770aae11cbe4","assignee":{"login":"JulkaIII","id":22578645,"avatar_url":"https://avatars2.githubusercontent.com/u/22578645?v=4","gravatar_id":"","url":"https://api.github.com/users/JulkaIII","html_url":"https://github.com/JulkaIII","followers_url":"https://api.github.com/users/JulkaIII/followers","following_url":"https://api.github.com/users/JulkaIII/following{/other_user}","gists_url":"https://api.github.com/users/JulkaIII/gists{/gist_id}","starred_url":"https://api.github.com/users/JulkaIII/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JulkaIII/subscriptions","organizations_url":"https://api.github.com/users/JulkaIII/orgs","repos_url":"https://api.github.com/users/JulkaIII/repos","events_url":"https://api.github.com/users/JulkaIII/events{/privacy}","received_events_url":"https://api.github.com/users/JulkaIII/received_events","type":"User","site_admin":false},"assignees":[{"login":"JulkaIII","id":22578645,"avatar_url":"https://avatars2.githubusercontent.com/u/22578645?v=4","gravatar_id":"","url":"https://api.github.com/users/JulkaIII","html_url":"https://github.com/JulkaIII","followers_url":"https://api.github.com/users/JulkaIII/followers","following_url":"https://api.github.com/users/JulkaIII/following{/other_user}","gists_url":"https://api.github.com/users/JulkaIII/gists{/gist_id}","starred_url":"https://api.github.com/users/JulkaIII/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JulkaIII/subscriptions","organizations_url":"https://api.github.com/users/JulkaIII/orgs","repos_url":"https://api.github.com/users/JulkaIII/repos","events_url":"https://api.github.com/users/JulkaIII/events{/privacy}","received_events_url":"https://api.github.com/users/JulkaIII/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/JulkaIII/todo-app-react/pulls/1/commits","review_comments_url":"https://api.github.com/repos/JulkaIII/todo-app-react/pulls/1/comments","review_comment_url":"https://api.github.com/repos/JulkaIII/todo-app-react/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JulkaIII/todo-app-react/issues/1/comments","statuses_url":"https://api.github.com/repos/JulkaIII/todo-app-react/statuses/1c9c242b2af29c0e3980768691c5af9a8af0a87f","head":{"label":"JulkaIII:components","ref":"components","sha":"1c9c242b2af29c0e3980768691c5af9a8af0a87f","user":{"login":"JulkaIII","id":22578645,"avatar_url":"https://avatars2.githubusercontent.com/u/22578645?v=4","gravatar_id":"","url":"https://api.github.com/users/JulkaIII","html_url":"https://github.com/JulkaIII","followers_url":"https://api.github.com/users/JulkaIII/followers","following_url":"https://api.github.com/users/JulkaIII/following{/other_user}","gists_url":"https://api.github.com/users/JulkaIII/gists{/gist_id}","starred_url":"https://api.github.com/users/JulkaIII/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JulkaIII/subscriptions","organizations_url":"https://api.github.com/users/JulkaIII/orgs","repos_url":"https://api.github.com/users/JulkaIII/repos","events_url":"https://api.github.com/users/JulkaIII/events{/privacy}","received_events_url":"https://api.github.com/users/JulkaIII/received_events","type":"User","site_admin":false},"repo":{"id":123729410,"name":"todo-app-react","full_name":"JulkaIII/todo-app-react","owner":{"login":"JulkaIII","id":22578645,"avatar_url":"https://avatars2.githubusercontent.com/u/22578645?v=4","gravatar_id":"","url":"https://api.github.com/users/JulkaIII","html_url":"https://github.com/JulkaIII","followers_url":"https://api.github.com/users/JulkaIII/followers","following_url":"https://api.github.com/users/JulkaIII/following{/other_user}","gists_url":"https://api.github.com/users/JulkaIII/gists{/gist_id}","starred_url":"https://api.github.com/users/JulkaIII/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JulkaIII/subscriptions","organizations_url":"https://api.github.com/users/JulkaIII/orgs","repos_url":"https://api.github.com/users/JulkaIII/repos","events_url":"https://api.github.com/users/JulkaIII/events{/privacy}","received_events_url":"https://api.github.com/users/JulkaIII/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JulkaIII/todo-app-react","description":null,"fork":false,"url":"https://api.github.com/repos/JulkaIII/todo-app-react","forks_url":"https://api.github.com/repos/JulkaIII/todo-app-react/forks","keys_url":"https://api.github.com/repos/JulkaIII/todo-app-react/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JulkaIII/todo-app-react/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JulkaIII/todo-app-react/teams","hooks_url":"https://api.github.com/repos/JulkaIII/todo-app-react/hooks","issue_events_url":"https://api.github.com/repos/JulkaIII/todo-app-react/issues/events{/number}","events_url":"https://api.github.com/repos/JulkaIII/todo-app-react/events","assignees_url":"https://api.github.com/repos/JulkaIII/todo-app-react/assignees{/user}","branches_url":"https://api.github.com/repos/JulkaIII/todo-app-react/branches{/branch}","tags_url":"https://api.github.com/repos/JulkaIII/todo-app-react/tags","blobs_url":"https://api.github.com/repos/JulkaIII/todo-app-react/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JulkaIII/todo-app-react/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JulkaIII/todo-app-react/git/refs{/sha}","trees_url":"https://api.github.com/repos/JulkaIII/todo-app-react/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JulkaIII/todo-app-react/statuses/{sha}","languages_url":"https://api.github.com/repos/JulkaIII/todo-app-react/languages","stargazers_url":"https://api.github.com/repos/JulkaIII/todo-app-react/stargazers","contributors_url":"https://api.github.com/repos/JulkaIII/todo-app-react/contributors","subscribers_url":"https://api.github.com/repos/JulkaIII/todo-app-react/subscribers","subscription_url":"https://api.github.com/repos/JulkaIII/todo-app-react/subscription","commits_url":"https://api.github.com/repos/JulkaIII/todo-app-react/commits{/sha}","git_commits_url":"https://api.github.com/repos/JulkaIII/todo-app-react/git/commits{/sha}","comments_url":"https://api.github.com/repos/JulkaIII/todo-app-react/comments{/number}","issue_comment_url":"https://api.github.com/repos/JulkaIII/todo-app-react/issues/comments{/number}","contents_url":"https://api.github.com/repos/JulkaIII/todo-app-react/contents/{+path}","compare_url":"https://api.github.com/repos/JulkaIII/todo-app-react/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JulkaIII/todo-app-react/merges","archive_url":"https://api.github.com/repos/JulkaIII/todo-app-react/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JulkaIII/todo-app-react/downloads","issues_url":"https://api.github.com/repos/JulkaIII/todo-app-react/issues{/number}","pulls_url":"https://api.github.com/repos/JulkaIII/todo-app-react/pulls{/number}","milestones_url":"https://api.github.com/repos/JulkaIII/todo-app-react/milestones{/number}","notifications_url":"https://api.github.com/repos/JulkaIII/todo-app-react/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JulkaIII/todo-app-react/labels{/name}","releases_url":"https://api.github.com/repos/JulkaIII/todo-app-react/releases{/id}","deployments_url":"https://api.github.com/repos/JulkaIII/todo-app-react/deployments","created_at":"2018-03-03T20:39:19Z","updated_at":"2018-03-15T19:59:34Z","pushed_at":"2018-03-15T20:44:56Z","git_url":"git://github.com/JulkaIII/todo-app-react.git","ssh_url":"git@github.com:JulkaIII/todo-app-react.git","clone_url":"https://github.com/JulkaIII/todo-app-react.git","svn_url":"https://github.com/JulkaIII/todo-app-react","homepage":null,"size":492,"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":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"JulkaIII:master","ref":"master","sha":"462fd1bc1d31ee03f3e51ce56b6b7359f479f5ab","user":{"login":"JulkaIII","id":22578645,"avatar_url":"https://avatars2.githubusercontent.com/u/22578645?v=4","gravatar_id":"","url":"https://api.github.com/users/JulkaIII","html_url":"https://github.com/JulkaIII","followers_url":"https://api.github.com/users/JulkaIII/followers","following_url":"https://api.github.com/users/JulkaIII/following{/other_user}","gists_url":"https://api.github.com/users/JulkaIII/gists{/gist_id}","starred_url":"https://api.github.com/users/JulkaIII/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JulkaIII/subscriptions","organizations_url":"https://api.github.com/users/JulkaIII/orgs","repos_url":"https://api.github.com/users/JulkaIII/repos","events_url":"https://api.github.com/users/JulkaIII/events{/privacy}","received_events_url":"https://api.github.com/users/JulkaIII/received_events","type":"User","site_admin":false},"repo":{"id":123729410,"name":"todo-app-react","full_name":"JulkaIII/todo-app-react","owner":{"login":"JulkaIII","id":22578645,"avatar_url":"https://avatars2.githubusercontent.com/u/22578645?v=4","gravatar_id":"","url":"https://api.github.com/users/JulkaIII","html_url":"https://github.com/JulkaIII","followers_url":"https://api.github.com/users/JulkaIII/followers","following_url":"https://api.github.com/users/JulkaIII/following{/other_user}","gists_url":"https://api.github.com/users/JulkaIII/gists{/gist_id}","starred_url":"https://api.github.com/users/JulkaIII/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JulkaIII/subscriptions","organizations_url":"https://api.github.com/users/JulkaIII/orgs","repos_url":"https://api.github.com/users/JulkaIII/repos","events_url":"https://api.github.com/users/JulkaIII/events{/privacy}","received_events_url":"https://api.github.com/users/JulkaIII/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JulkaIII/todo-app-react","description":null,"fork":false,"url":"https://api.github.com/repos/JulkaIII/todo-app-react","forks_url":"https://api.github.com/repos/JulkaIII/todo-app-react/forks","keys_url":"https://api.github.com/repos/JulkaIII/todo-app-react/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JulkaIII/todo-app-react/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JulkaIII/todo-app-react/teams","hooks_url":"https://api.github.com/repos/JulkaIII/todo-app-react/hooks","issue_events_url":"https://api.github.com/repos/JulkaIII/todo-app-react/issues/events{/number}","events_url":"https://api.github.com/repos/JulkaIII/todo-app-react/events","assignees_url":"https://api.github.com/repos/JulkaIII/todo-app-react/assignees{/user}","branches_url":"https://api.github.com/repos/JulkaIII/todo-app-react/branches{/branch}","tags_url":"https://api.github.com/repos/JulkaIII/todo-app-react/tags","blobs_url":"https://api.github.com/repos/JulkaIII/todo-app-react/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JulkaIII/todo-app-react/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JulkaIII/todo-app-react/git/refs{/sha}","trees_url":"https://api.github.com/repos/JulkaIII/todo-app-react/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JulkaIII/todo-app-react/statuses/{sha}","languages_url":"https://api.github.com/repos/JulkaIII/todo-app-react/languages","stargazers_url":"https://api.github.com/repos/JulkaIII/todo-app-react/stargazers","contributors_url":"https://api.github.com/repos/JulkaIII/todo-app-react/contributors","subscribers_url":"https://api.github.com/repos/JulkaIII/todo-app-react/subscribers","subscription_url":"https://api.github.com/repos/JulkaIII/todo-app-react/subscription","commits_url":"https://api.github.com/repos/JulkaIII/todo-app-react/commits{/sha}","git_commits_url":"https://api.github.com/repos/JulkaIII/todo-app-react/git/commits{/sha}","comments_url":"https://api.github.com/repos/JulkaIII/todo-app-react/comments{/number}","issue_comment_url":"https://api.github.com/repos/JulkaIII/todo-app-react/issues/comments{/number}","contents_url":"https://api.github.com/repos/JulkaIII/todo-app-react/contents/{+path}","compare_url":"https://api.github.com/repos/JulkaIII/todo-app-react/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JulkaIII/todo-app-react/merges","archive_url":"https://api.github.com/repos/JulkaIII/todo-app-react/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JulkaIII/todo-app-react/downloads","issues_url":"https://api.github.com/repos/JulkaIII/todo-app-react/issues{/number}","pulls_url":"https://api.github.com/repos/JulkaIII/todo-app-react/pulls{/number}","milestones_url":"https://api.github.com/repos/JulkaIII/todo-app-react/milestones{/number}","notifications_url":"https://api.github.com/repos/JulkaIII/todo-app-react/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JulkaIII/todo-app-react/labels{/name}","releases_url":"https://api.github.com/repos/JulkaIII/todo-app-react/releases{/id}","deployments_url":"https://api.github.com/repos/JulkaIII/todo-app-react/deployments","created_at":"2018-03-03T20:39:19Z","updated_at":"2018-03-15T19:59:34Z","pushed_at":"2018-03-15T20:44:56Z","git_url":"git://github.com/JulkaIII/todo-app-react.git","ssh_url":"git@github.com:JulkaIII/todo-app-react.git","clone_url":"https://github.com/JulkaIII/todo-app-react.git","svn_url":"https://github.com/JulkaIII/todo-app-react","homepage":null,"size":492,"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":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JulkaIII/todo-app-react/pulls/1"},"html":{"href":"https://github.com/JulkaIII/todo-app-react/pull/1"},"issue":{"href":"https://api.github.com/repos/JulkaIII/todo-app-react/issues/1"},"comments":{"href":"https://api.github.com/repos/JulkaIII/todo-app-react/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/JulkaIII/todo-app-react/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/JulkaIII/todo-app-react/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JulkaIII/todo-app-react/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/JulkaIII/todo-app-react/statuses/1c9c242b2af29c0e3980768691c5af9a8af0a87f"}},"author_association":"OWNER"}}
{"actor":{"display_login":"yuriimelnyk"}}