{"action":"created","comment":{"url":"https://api.github.com/repos/Matroskin94/react_app/pulls/comments/168916711","pull_request_review_id":97369245,"id":168916711,"diff_hunk":"@@ -1,37 +1,62 @@\n-import { GO_PRESSED, LOCATION_PRESSED } from '../constants/constants';\r\n-import { extractData, checkError } from '../utils/SearchUtils';\r\n+import { GO_PRESSED, QUERY_LINK, QUERY_SELECTED } from '../constants/constants';\r\n+import { checkError, extractData } from '../utils/SearchUtils';\r\n \r\n-export function searchAction(text) {\r\n+export const searchResultAction = (word, resultsNum) => {\r\n     return ({\r\n         type: GO_PRESSED,\r\n-        payload: text\r\n+        payload: {\r\n+            word,\r\n+            resultsNum\r\n+        }\r\n     });\r\n-}\r\n+};\r\n \r\n-export function locationsResultAction(data) {\r\n+export const chooseQueryAction = (results, word) => {\r\n     return ({\r\n-        type: LOCATION_PRESSED,\r\n-        payload: data\r\n+        type: QUERY_SELECTED,\r\n+        payload: {\r\n+            results,\r\n+            word\r\n+        }\r\n     });\r\n-}\r\n+};\r\n \r\n-export const searchLocationsAction = dispatch => text => {\r\n-    fetch(`http://api.nestoria.co.uk/api?country=uk&pretty=1&action=search_listings&encoding=json&listing_type=buy&page=1&place_name=${text}`)\r\n+export const searchAction = dispatch => text => {\r\n+    fetch(`${QUERY_LINK + text}`)\r\n+        .then(response => response.json())\r\n+        .then((response, reject) => {\r\n+            const error = checkError(response);\r","path":"src/actions/SearchActions.js","position":39,"original_position":39,"commit_id":"a4e9e069997929a7ca28397784396188a6bf955d","original_commit_id":"a4e9e069997929a7ca28397784396188a6bf955d","user":{"login":"kkamik","id":11601969,"avatar_url":"https://avatars1.githubusercontent.com/u/11601969?v=4","gravatar_id":"","url":"https://api.github.com/users/kkamik","html_url":"https://github.com/kkamik","followers_url":"https://api.github.com/users/kkamik/followers","following_url":"https://api.github.com/users/kkamik/following{/other_user}","gists_url":"https://api.github.com/users/kkamik/gists{/gist_id}","starred_url":"https://api.github.com/users/kkamik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkamik/subscriptions","organizations_url":"https://api.github.com/users/kkamik/orgs","repos_url":"https://api.github.com/users/kkamik/repos","events_url":"https://api.github.com/users/kkamik/events{/privacy}","received_events_url":"https://api.github.com/users/kkamik/received_events","type":"User","site_admin":false},"body":"checkError нужно использовать примерно так\r\n.then(action)\r\n.then(checkError)","created_at":"2018-02-17T08:48:37Z","updated_at":"2018-02-17T08:48:37Z","html_url":"https://github.com/Matroskin94/react_app/pull/5#discussion_r168916711","pull_request_url":"https://api.github.com/repos/Matroskin94/react_app/pulls/5","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Matroskin94/react_app/pulls/comments/168916711"},"html":{"href":"https://github.com/Matroskin94/react_app/pull/5#discussion_r168916711"},"pull_request":{"href":"https://api.github.com/repos/Matroskin94/react_app/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/Matroskin94/react_app/pulls/5","id":169395554,"html_url":"https://github.com/Matroskin94/react_app/pull/5","diff_url":"https://github.com/Matroskin94/react_app/pull/5.diff","patch_url":"https://github.com/Matroskin94/react_app/pull/5.patch","issue_url":"https://api.github.com/repos/Matroskin94/react_app/issues/5","number":5,"state":"open","locked":false,"title":"Async actions creating","user":{"login":"Matroskin94","id":15139637,"avatar_url":"https://avatars1.githubusercontent.com/u/15139637?v=4","gravatar_id":"","url":"https://api.github.com/users/Matroskin94","html_url":"https://github.com/Matroskin94","followers_url":"https://api.github.com/users/Matroskin94/followers","following_url":"https://api.github.com/users/Matroskin94/following{/other_user}","gists_url":"https://api.github.com/users/Matroskin94/gists{/gist_id}","starred_url":"https://api.github.com/users/Matroskin94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Matroskin94/subscriptions","organizations_url":"https://api.github.com/users/Matroskin94/orgs","repos_url":"https://api.github.com/users/Matroskin94/repos","events_url":"https://api.github.com/users/Matroskin94/events{/privacy}","received_events_url":"https://api.github.com/users/Matroskin94/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-02-15T15:03:44Z","updated_at":"2018-02-17T08:48:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"68f1b1e6a835e1bcdff730c5b94df243e050842b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Matroskin94/react_app/pulls/5/commits","review_comments_url":"https://api.github.com/repos/Matroskin94/react_app/pulls/5/comments","review_comment_url":"https://api.github.com/repos/Matroskin94/react_app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Matroskin94/react_app/issues/5/comments","statuses_url":"https://api.github.com/repos/Matroskin94/react_app/statuses/a4e9e069997929a7ca28397784396188a6bf955d","head":{"label":"Matroskin94:async","ref":"async","sha":"a4e9e069997929a7ca28397784396188a6bf955d","user":{"login":"Matroskin94","id":15139637,"avatar_url":"https://avatars1.githubusercontent.com/u/15139637?v=4","gravatar_id":"","url":"https://api.github.com/users/Matroskin94","html_url":"https://github.com/Matroskin94","followers_url":"https://api.github.com/users/Matroskin94/followers","following_url":"https://api.github.com/users/Matroskin94/following{/other_user}","gists_url":"https://api.github.com/users/Matroskin94/gists{/gist_id}","starred_url":"https://api.github.com/users/Matroskin94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Matroskin94/subscriptions","organizations_url":"https://api.github.com/users/Matroskin94/orgs","repos_url":"https://api.github.com/users/Matroskin94/repos","events_url":"https://api.github.com/users/Matroskin94/events{/privacy}","received_events_url":"https://api.github.com/users/Matroskin94/received_events","type":"User","site_admin":false},"repo":{"id":119850560,"name":"react_app","full_name":"Matroskin94/react_app","owner":{"login":"Matroskin94","id":15139637,"avatar_url":"https://avatars1.githubusercontent.com/u/15139637?v=4","gravatar_id":"","url":"https://api.github.com/users/Matroskin94","html_url":"https://github.com/Matroskin94","followers_url":"https://api.github.com/users/Matroskin94/followers","following_url":"https://api.github.com/users/Matroskin94/following{/other_user}","gists_url":"https://api.github.com/users/Matroskin94/gists{/gist_id}","starred_url":"https://api.github.com/users/Matroskin94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Matroskin94/subscriptions","organizations_url":"https://api.github.com/users/Matroskin94/orgs","repos_url":"https://api.github.com/users/Matroskin94/repos","events_url":"https://api.github.com/users/Matroskin94/events{/privacy}","received_events_url":"https://api.github.com/users/Matroskin94/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Matroskin94/react_app","description":null,"fork":false,"url":"https://api.github.com/repos/Matroskin94/react_app","forks_url":"https://api.github.com/repos/Matroskin94/react_app/forks","keys_url":"https://api.github.com/repos/Matroskin94/react_app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Matroskin94/react_app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Matroskin94/react_app/teams","hooks_url":"https://api.github.com/repos/Matroskin94/react_app/hooks","issue_events_url":"https://api.github.com/repos/Matroskin94/react_app/issues/events{/number}","events_url":"https://api.github.com/repos/Matroskin94/react_app/events","assignees_url":"https://api.github.com/repos/Matroskin94/react_app/assignees{/user}","branches_url":"https://api.github.com/repos/Matroskin94/react_app/branches{/branch}","tags_url":"https://api.github.com/repos/Matroskin94/react_app/tags","blobs_url":"https://api.github.com/repos/Matroskin94/react_app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Matroskin94/react_app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Matroskin94/react_app/git/refs{/sha}","trees_url":"https://api.github.com/repos/Matroskin94/react_app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Matroskin94/react_app/statuses/{sha}","languages_url":"https://api.github.com/repos/Matroskin94/react_app/languages","stargazers_url":"https://api.github.com/repos/Matroskin94/react_app/stargazers","contributors_url":"https://api.github.com/repos/Matroskin94/react_app/contributors","subscribers_url":"https://api.github.com/repos/Matroskin94/react_app/subscribers","subscription_url":"https://api.github.com/repos/Matroskin94/react_app/subscription","commits_url":"https://api.github.com/repos/Matroskin94/react_app/commits{/sha}","git_commits_url":"https://api.github.com/repos/Matroskin94/react_app/git/commits{/sha}","comments_url":"https://api.github.com/repos/Matroskin94/react_app/comments{/number}","issue_comment_url":"https://api.github.com/repos/Matroskin94/react_app/issues/comments{/number}","contents_url":"https://api.github.com/repos/Matroskin94/react_app/contents/{+path}","compare_url":"https://api.github.com/repos/Matroskin94/react_app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Matroskin94/react_app/merges","archive_url":"https://api.github.com/repos/Matroskin94/react_app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Matroskin94/react_app/downloads","issues_url":"https://api.github.com/repos/Matroskin94/react_app/issues{/number}","pulls_url":"https://api.github.com/repos/Matroskin94/react_app/pulls{/number}","milestones_url":"https://api.github.com/repos/Matroskin94/react_app/milestones{/number}","notifications_url":"https://api.github.com/repos/Matroskin94/react_app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Matroskin94/react_app/labels{/name}","releases_url":"https://api.github.com/repos/Matroskin94/react_app/releases{/id}","deployments_url":"https://api.github.com/repos/Matroskin94/react_app/deployments","created_at":"2018-02-01T14:58:50Z","updated_at":"2018-02-01T15:06:16Z","pushed_at":"2018-02-16T12:41:26Z","git_url":"git://github.com/Matroskin94/react_app.git","ssh_url":"git@github.com:Matroskin94/react_app.git","clone_url":"https://github.com/Matroskin94/react_app.git","svn_url":"https://github.com/Matroskin94/react_app","homepage":null,"size":11225,"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":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Matroskin94:master","ref":"master","sha":"5615a312ef6abaf65969a38d14c098cba81b3dc0","user":{"login":"Matroskin94","id":15139637,"avatar_url":"https://avatars1.githubusercontent.com/u/15139637?v=4","gravatar_id":"","url":"https://api.github.com/users/Matroskin94","html_url":"https://github.com/Matroskin94","followers_url":"https://api.github.com/users/Matroskin94/followers","following_url":"https://api.github.com/users/Matroskin94/following{/other_user}","gists_url":"https://api.github.com/users/Matroskin94/gists{/gist_id}","starred_url":"https://api.github.com/users/Matroskin94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Matroskin94/subscriptions","organizations_url":"https://api.github.com/users/Matroskin94/orgs","repos_url":"https://api.github.com/users/Matroskin94/repos","events_url":"https://api.github.com/users/Matroskin94/events{/privacy}","received_events_url":"https://api.github.com/users/Matroskin94/received_events","type":"User","site_admin":false},"repo":{"id":119850560,"name":"react_app","full_name":"Matroskin94/react_app","owner":{"login":"Matroskin94","id":15139637,"avatar_url":"https://avatars1.githubusercontent.com/u/15139637?v=4","gravatar_id":"","url":"https://api.github.com/users/Matroskin94","html_url":"https://github.com/Matroskin94","followers_url":"https://api.github.com/users/Matroskin94/followers","following_url":"https://api.github.com/users/Matroskin94/following{/other_user}","gists_url":"https://api.github.com/users/Matroskin94/gists{/gist_id}","starred_url":"https://api.github.com/users/Matroskin94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Matroskin94/subscriptions","organizations_url":"https://api.github.com/users/Matroskin94/orgs","repos_url":"https://api.github.com/users/Matroskin94/repos","events_url":"https://api.github.com/users/Matroskin94/events{/privacy}","received_events_url":"https://api.github.com/users/Matroskin94/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Matroskin94/react_app","description":null,"fork":false,"url":"https://api.github.com/repos/Matroskin94/react_app","forks_url":"https://api.github.com/repos/Matroskin94/react_app/forks","keys_url":"https://api.github.com/repos/Matroskin94/react_app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Matroskin94/react_app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Matroskin94/react_app/teams","hooks_url":"https://api.github.com/repos/Matroskin94/react_app/hooks","issue_events_url":"https://api.github.com/repos/Matroskin94/react_app/issues/events{/number}","events_url":"https://api.github.com/repos/Matroskin94/react_app/events","assignees_url":"https://api.github.com/repos/Matroskin94/react_app/assignees{/user}","branches_url":"https://api.github.com/repos/Matroskin94/react_app/branches{/branch}","tags_url":"https://api.github.com/repos/Matroskin94/react_app/tags","blobs_url":"https://api.github.com/repos/Matroskin94/react_app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Matroskin94/react_app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Matroskin94/react_app/git/refs{/sha}","trees_url":"https://api.github.com/repos/Matroskin94/react_app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Matroskin94/react_app/statuses/{sha}","languages_url":"https://api.github.com/repos/Matroskin94/react_app/languages","stargazers_url":"https://api.github.com/repos/Matroskin94/react_app/stargazers","contributors_url":"https://api.github.com/repos/Matroskin94/react_app/contributors","subscribers_url":"https://api.github.com/repos/Matroskin94/react_app/subscribers","subscription_url":"https://api.github.com/repos/Matroskin94/react_app/subscription","commits_url":"https://api.github.com/repos/Matroskin94/react_app/commits{/sha}","git_commits_url":"https://api.github.com/repos/Matroskin94/react_app/git/commits{/sha}","comments_url":"https://api.github.com/repos/Matroskin94/react_app/comments{/number}","issue_comment_url":"https://api.github.com/repos/Matroskin94/react_app/issues/comments{/number}","contents_url":"https://api.github.com/repos/Matroskin94/react_app/contents/{+path}","compare_url":"https://api.github.com/repos/Matroskin94/react_app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Matroskin94/react_app/merges","archive_url":"https://api.github.com/repos/Matroskin94/react_app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Matroskin94/react_app/downloads","issues_url":"https://api.github.com/repos/Matroskin94/react_app/issues{/number}","pulls_url":"https://api.github.com/repos/Matroskin94/react_app/pulls{/number}","milestones_url":"https://api.github.com/repos/Matroskin94/react_app/milestones{/number}","notifications_url":"https://api.github.com/repos/Matroskin94/react_app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Matroskin94/react_app/labels{/name}","releases_url":"https://api.github.com/repos/Matroskin94/react_app/releases{/id}","deployments_url":"https://api.github.com/repos/Matroskin94/react_app/deployments","created_at":"2018-02-01T14:58:50Z","updated_at":"2018-02-01T15:06:16Z","pushed_at":"2018-02-16T12:41:26Z","git_url":"git://github.com/Matroskin94/react_app.git","ssh_url":"git@github.com:Matroskin94/react_app.git","clone_url":"https://github.com/Matroskin94/react_app.git","svn_url":"https://github.com/Matroskin94/react_app","homepage":null,"size":11225,"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":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Matroskin94/react_app/pulls/5"},"html":{"href":"https://github.com/Matroskin94/react_app/pull/5"},"issue":{"href":"https://api.github.com/repos/Matroskin94/react_app/issues/5"},"comments":{"href":"https://api.github.com/repos/Matroskin94/react_app/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/Matroskin94/react_app/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/Matroskin94/react_app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Matroskin94/react_app/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/Matroskin94/react_app/statuses/a4e9e069997929a7ca28397784396188a6bf955d"}},"author_association":"OWNER"}}
{"actor":{"display_login":"kkamik"}}