{"action":"created","comment":{"url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/pulls/comments/241947088","pull_request_review_id":185352278,"id":241947088,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MTk0NzA4OA==","diff_hunk":"@@ -0,0 +1,67 @@\n+'use strict';\n+(function () {\n+  window.backend = {\n+    xhrResponseHandler: function (xhr, onLoad, onError) {\n+      var error;\n+      switch (xhr.status) {\n+        case 200:\n+          onLoad(xhr.response);\n+          break;\n+        case 400:\n+          error = 'Неверный запрос';\n+          break;\n+        case 401:\n+          error = 'Пользователь не авторизован';\n+          break;\n+        case 404:\n+          error = 'Ничего не найдено';\n+          break;\n+\n+        default:\n+          error = 'Cтатус ответа: : ' + xhr.status + ' ' + xhr.statusText;\n+      }\n+      if (error) {\n+        onError(error);\n+      }\n+    },\n+    xhrErrorHanler: function (xhr, onError) {\n+      xhr.addEventListener('error', function () {\n+        onError('Произошла ошибка соединения');\n+      });\n+    },\n+    xhrTimeoutHanler: function (xhr, onError, time) {\n+      xhr.addEventListener('timeout', function () {\n+        onError('Запрос не успел выполниться за ' + xhr.timeout + 'мс');\n+      });\n+      xhr.timeout = time;\n+    },\n+    load: function (onLoad, onError) {","path":"js/backend.js","position":38,"original_position":38,"commit_id":"c2e547ffd0c14a524955044498b16030298500ef","original_commit_id":"c2e547ffd0c14a524955044498b16030298500ef","user":{"login":"fidelman","id":15198653,"node_id":"MDQ6VXNlcjE1MTk4NjUz","avatar_url":"https://avatars0.githubusercontent.com/u/15198653?v=4","gravatar_id":"","url":"https://api.github.com/users/fidelman","html_url":"https://github.com/fidelman","followers_url":"https://api.github.com/users/fidelman/followers","following_url":"https://api.github.com/users/fidelman/following{/other_user}","gists_url":"https://api.github.com/users/fidelman/gists{/gist_id}","starred_url":"https://api.github.com/users/fidelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fidelman/subscriptions","organizations_url":"https://api.github.com/users/fidelman/orgs","repos_url":"https://api.github.com/users/fidelman/repos","events_url":"https://api.github.com/users/fidelman/events{/privacy}","received_events_url":"https://api.github.com/users/fidelman/received_events","type":"User","site_admin":false},"body":"методы load и save практически одинаковые, единственная разница в url, data (обычно ее называют body https://stackoverflow.com/questions/22034144/what-does-it-mean-http-request-body )  и method. Рекомендую создать метод apiRequest({ url, method, body }) и переиспользовать","created_at":"2018-12-15T11:49:34Z","updated_at":"2018-12-15T11:49:54Z","html_url":"https://github.com/htmlacademy-javascript/200490-code-and-magick/pull/7#discussion_r241947088","pull_request_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/pulls/7","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/pulls/comments/241947088"},"html":{"href":"https://github.com/htmlacademy-javascript/200490-code-and-magick/pull/7#discussion_r241947088"},"pull_request":{"href":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/pulls/7","id":238893802,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM4ODkzODAy","html_url":"https://github.com/htmlacademy-javascript/200490-code-and-magick/pull/7","diff_url":"https://github.com/htmlacademy-javascript/200490-code-and-magick/pull/7.diff","patch_url":"https://github.com/htmlacademy-javascript/200490-code-and-magick/pull/7.patch","issue_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/issues/7","number":7,"state":"open","locked":false,"title":"Учебный проект: pimp my mage","user":{"login":"concentrator","id":30862887,"node_id":"MDQ6VXNlcjMwODYyODg3","avatar_url":"https://avatars1.githubusercontent.com/u/30862887?v=4","gravatar_id":"","url":"https://api.github.com/users/concentrator","html_url":"https://github.com/concentrator","followers_url":"https://api.github.com/users/concentrator/followers","following_url":"https://api.github.com/users/concentrator/following{/other_user}","gists_url":"https://api.github.com/users/concentrator/gists{/gist_id}","starred_url":"https://api.github.com/users/concentrator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/concentrator/subscriptions","organizations_url":"https://api.github.com/users/concentrator/orgs","repos_url":"https://api.github.com/users/concentrator/repos","events_url":"https://api.github.com/users/concentrator/events{/privacy}","received_events_url":"https://api.github.com/users/concentrator/received_events","type":"User","site_admin":false},"body":"\n\n---\n:mortar_board: [Учебный проект: pimp my mage](https://up.htmlacademy.ru/javascript/16/user/200490/tasks/22)","created_at":"2018-12-15T06:11:55Z","updated_at":"2018-12-15T11:49:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"268ae28b902402edb65b37af328ca42937caa2aa","assignee":{"login":"fidelman","id":15198653,"node_id":"MDQ6VXNlcjE1MTk4NjUz","avatar_url":"https://avatars0.githubusercontent.com/u/15198653?v=4","gravatar_id":"","url":"https://api.github.com/users/fidelman","html_url":"https://github.com/fidelman","followers_url":"https://api.github.com/users/fidelman/followers","following_url":"https://api.github.com/users/fidelman/following{/other_user}","gists_url":"https://api.github.com/users/fidelman/gists{/gist_id}","starred_url":"https://api.github.com/users/fidelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fidelman/subscriptions","organizations_url":"https://api.github.com/users/fidelman/orgs","repos_url":"https://api.github.com/users/fidelman/repos","events_url":"https://api.github.com/users/fidelman/events{/privacy}","received_events_url":"https://api.github.com/users/fidelman/received_events","type":"User","site_admin":false},"assignees":[{"login":"fidelman","id":15198653,"node_id":"MDQ6VXNlcjE1MTk4NjUz","avatar_url":"https://avatars0.githubusercontent.com/u/15198653?v=4","gravatar_id":"","url":"https://api.github.com/users/fidelman","html_url":"https://github.com/fidelman","followers_url":"https://api.github.com/users/fidelman/followers","following_url":"https://api.github.com/users/fidelman/following{/other_user}","gists_url":"https://api.github.com/users/fidelman/gists{/gist_id}","starred_url":"https://api.github.com/users/fidelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fidelman/subscriptions","organizations_url":"https://api.github.com/users/fidelman/orgs","repos_url":"https://api.github.com/users/fidelman/repos","events_url":"https://api.github.com/users/fidelman/events{/privacy}","received_events_url":"https://api.github.com/users/fidelman/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/pulls/7/commits","review_comments_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/pulls/7/comments","review_comment_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/pulls/comments{/number}","comments_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/issues/7/comments","statuses_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/statuses/c2e547ffd0c14a524955044498b16030298500ef","head":{"label":"concentrator:module6-task1","ref":"module6-task1","sha":"c2e547ffd0c14a524955044498b16030298500ef","user":{"login":"concentrator","id":30862887,"node_id":"MDQ6VXNlcjMwODYyODg3","avatar_url":"https://avatars1.githubusercontent.com/u/30862887?v=4","gravatar_id":"","url":"https://api.github.com/users/concentrator","html_url":"https://github.com/concentrator","followers_url":"https://api.github.com/users/concentrator/followers","following_url":"https://api.github.com/users/concentrator/following{/other_user}","gists_url":"https://api.github.com/users/concentrator/gists{/gist_id}","starred_url":"https://api.github.com/users/concentrator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/concentrator/subscriptions","organizations_url":"https://api.github.com/users/concentrator/orgs","repos_url":"https://api.github.com/users/concentrator/repos","events_url":"https://api.github.com/users/concentrator/events{/privacy}","received_events_url":"https://api.github.com/users/concentrator/received_events","type":"User","site_admin":false},"repo":{"id":158030496,"node_id":"MDEwOlJlcG9zaXRvcnkxNTgwMzA0OTY=","name":"200490-code-and-magick","full_name":"concentrator/200490-code-and-magick","private":false,"owner":{"login":"concentrator","id":30862887,"node_id":"MDQ6VXNlcjMwODYyODg3","avatar_url":"https://avatars1.githubusercontent.com/u/30862887?v=4","gravatar_id":"","url":"https://api.github.com/users/concentrator","html_url":"https://github.com/concentrator","followers_url":"https://api.github.com/users/concentrator/followers","following_url":"https://api.github.com/users/concentrator/following{/other_user}","gists_url":"https://api.github.com/users/concentrator/gists{/gist_id}","starred_url":"https://api.github.com/users/concentrator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/concentrator/subscriptions","organizations_url":"https://api.github.com/users/concentrator/orgs","repos_url":"https://api.github.com/users/concentrator/repos","events_url":"https://api.github.com/users/concentrator/events{/privacy}","received_events_url":"https://api.github.com/users/concentrator/received_events","type":"User","site_admin":false},"html_url":"https://github.com/concentrator/200490-code-and-magick","description":"Дмитрий Иовлев","fork":true,"url":"https://api.github.com/repos/concentrator/200490-code-and-magick","forks_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/forks","keys_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/keys{/key_id}","collaborators_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/teams","hooks_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/hooks","issue_events_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/issues/events{/number}","events_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/events","assignees_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/assignees{/user}","branches_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/branches{/branch}","tags_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/tags","blobs_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/git/refs{/sha}","trees_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/git/trees{/sha}","statuses_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/statuses/{sha}","languages_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/languages","stargazers_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/stargazers","contributors_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/contributors","subscribers_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/subscribers","subscription_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/subscription","commits_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/commits{/sha}","git_commits_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/git/commits{/sha}","comments_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/comments{/number}","issue_comment_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/issues/comments{/number}","contents_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/contents/{+path}","compare_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/compare/{base}...{head}","merges_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/merges","archive_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/downloads","issues_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/issues{/number}","pulls_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/pulls{/number}","milestones_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/milestones{/number}","notifications_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/labels{/name}","releases_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/releases{/id}","deployments_url":"https://api.github.com/repos/concentrator/200490-code-and-magick/deployments","created_at":"2018-11-17T22:33:39Z","updated_at":"2018-12-14T14:02:30Z","pushed_at":"2018-12-15T06:23:52Z","git_url":"git://github.com/concentrator/200490-code-and-magick.git","ssh_url":"git@github.com:concentrator/200490-code-and-magick.git","clone_url":"https://github.com/concentrator/200490-code-and-magick.git","svn_url":"https://github.com/concentrator/200490-code-and-magick","homepage":null,"size":1103,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":false,"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":"htmlacademy-javascript:master","ref":"master","sha":"f84c9e0a3ab9bcf300a36cd1c70ad1e004d993af","user":{"login":"htmlacademy-javascript","id":14179712,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTc5NzEy","avatar_url":"https://avatars2.githubusercontent.com/u/14179712?v=4","gravatar_id":"","url":"https://api.github.com/users/htmlacademy-javascript","html_url":"https://github.com/htmlacademy-javascript","followers_url":"https://api.github.com/users/htmlacademy-javascript/followers","following_url":"https://api.github.com/users/htmlacademy-javascript/following{/other_user}","gists_url":"https://api.github.com/users/htmlacademy-javascript/gists{/gist_id}","starred_url":"https://api.github.com/users/htmlacademy-javascript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htmlacademy-javascript/subscriptions","organizations_url":"https://api.github.com/users/htmlacademy-javascript/orgs","repos_url":"https://api.github.com/users/htmlacademy-javascript/repos","events_url":"https://api.github.com/users/htmlacademy-javascript/events{/privacy}","received_events_url":"https://api.github.com/users/htmlacademy-javascript/received_events","type":"Organization","site_admin":false},"repo":{"id":158029754,"node_id":"MDEwOlJlcG9zaXRvcnkxNTgwMjk3NTQ=","name":"200490-code-and-magick","full_name":"htmlacademy-javascript/200490-code-and-magick","private":false,"owner":{"login":"htmlacademy-javascript","id":14179712,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTc5NzEy","avatar_url":"https://avatars2.githubusercontent.com/u/14179712?v=4","gravatar_id":"","url":"https://api.github.com/users/htmlacademy-javascript","html_url":"https://github.com/htmlacademy-javascript","followers_url":"https://api.github.com/users/htmlacademy-javascript/followers","following_url":"https://api.github.com/users/htmlacademy-javascript/following{/other_user}","gists_url":"https://api.github.com/users/htmlacademy-javascript/gists{/gist_id}","starred_url":"https://api.github.com/users/htmlacademy-javascript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htmlacademy-javascript/subscriptions","organizations_url":"https://api.github.com/users/htmlacademy-javascript/orgs","repos_url":"https://api.github.com/users/htmlacademy-javascript/repos","events_url":"https://api.github.com/users/htmlacademy-javascript/events{/privacy}","received_events_url":"https://api.github.com/users/htmlacademy-javascript/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/htmlacademy-javascript/200490-code-and-magick","description":"Дмитрий Иовлев","fork":false,"url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick","forks_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/forks","keys_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/keys{/key_id}","collaborators_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/teams","hooks_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/hooks","issue_events_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/issues/events{/number}","events_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/events","assignees_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/assignees{/user}","branches_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/branches{/branch}","tags_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/tags","blobs_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/git/refs{/sha}","trees_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/git/trees{/sha}","statuses_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/statuses/{sha}","languages_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/languages","stargazers_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/stargazers","contributors_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/contributors","subscribers_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/subscribers","subscription_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/subscription","commits_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/commits{/sha}","git_commits_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/git/commits{/sha}","comments_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/comments{/number}","issue_comment_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/issues/comments{/number}","contents_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/contents/{+path}","compare_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/compare/{base}...{head}","merges_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/merges","archive_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/downloads","issues_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/issues{/number}","pulls_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/pulls{/number}","milestones_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/milestones{/number}","notifications_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/labels{/name}","releases_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/releases{/id}","deployments_url":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/deployments","created_at":"2018-11-17T22:20:38Z","updated_at":"2018-12-12T21:16:59Z","pushed_at":"2018-12-15T06:23:54Z","git_url":"git://github.com/htmlacademy-javascript/200490-code-and-magick.git","ssh_url":"git@github.com:htmlacademy-javascript/200490-code-and-magick.git","clone_url":"https://github.com/htmlacademy-javascript/200490-code-and-magick.git","svn_url":"https://github.com/htmlacademy-javascript/200490-code-and-magick","homepage":"https://github.com/concentrator/200490-code-and-magick","size":1099,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/pulls/7"},"html":{"href":"https://github.com/htmlacademy-javascript/200490-code-and-magick/pull/7"},"issue":{"href":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/issues/7"},"comments":{"href":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/htmlacademy-javascript/200490-code-and-magick/statuses/c2e547ffd0c14a524955044498b16030298500ef"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"fidelman"}}