{"action":"created","comment":{"url":"https://api.github.com/repos/jaburcodes/pantheon-app/pulls/comments/204226547","pull_request_review_id":139274098,"id":204226547,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNDIyNjU0Nw==","diff_hunk":"@@ -1,22 +1,23 @@\n-export const getLocation = (\n-  address: string,\n-  number: string,\n-  cep: string,\n-  setLocation: (address: string, lat: number, lng: number) => void,\n-) => {\n-  const newAddress = `${address},${number}-${cep}`;\n-  const url = `https://maps.google.com/maps/api/geocode/json?address=${newAddress}&sensor=false`;\n-  fetch(url, {})\n-    .then(function(res) {\n-      return res.text();\n-    })\n-    .then(function(body) {\n-      const geoLocation = JSON.parse(body);\n-      console.log(geoLocation);\n-      const formatted_address = geoLocation.results[0].formatted_address;\n-      const lat = geoLocation.results[0].geometry.location.lat;\n-      const lng = geoLocation.results[0].geometry.location.lng;\n+export const getLocation = async (zip: string, number: string) => {\n+  const url = `https://maps.google.com/maps/api/geocode/json?address=${zip}&sensor=false`;\n \n-      setLocation(formatted_address, lat, lng);\n-    });\n+  const res = await fetch(url);\n+  const location = await res.json();\n+\n+  const { geometry, formatted_address } = location.results[0];\n+  const { lat, lng } = geometry.location;","path":"src/utils/api.js","position":28,"original_position":28,"commit_id":"c988136fe0ec33d2094d5a5c1a5c1fefad16f959","original_commit_id":"c988136fe0ec33d2094d5a5c1a5c1fefad16f959","user":{"login":"jaburcodes","id":13947203,"node_id":"MDQ6VXNlcjEzOTQ3MjAz","avatar_url":"https://avatars0.githubusercontent.com/u/13947203?v=4","gravatar_id":"","url":"https://api.github.com/users/jaburcodes","html_url":"https://github.com/jaburcodes","followers_url":"https://api.github.com/users/jaburcodes/followers","following_url":"https://api.github.com/users/jaburcodes/following{/other_user}","gists_url":"https://api.github.com/users/jaburcodes/gists{/gist_id}","starred_url":"https://api.github.com/users/jaburcodes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaburcodes/subscriptions","organizations_url":"https://api.github.com/users/jaburcodes/orgs","repos_url":"https://api.github.com/users/jaburcodes/repos","events_url":"https://api.github.com/users/jaburcodes/events{/privacy}","received_events_url":"https://api.github.com/users/jaburcodes/received_events","type":"User","site_admin":false},"body":"thats what i call destructuring, good.","created_at":"2018-07-22T02:40:39Z","updated_at":"2018-07-22T02:40:39Z","html_url":"https://github.com/jaburcodes/pantheon-app/pull/7#discussion_r204226547","pull_request_url":"https://api.github.com/repos/jaburcodes/pantheon-app/pulls/7","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/jaburcodes/pantheon-app/pulls/comments/204226547"},"html":{"href":"https://github.com/jaburcodes/pantheon-app/pull/7#discussion_r204226547"},"pull_request":{"href":"https://api.github.com/repos/jaburcodes/pantheon-app/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/jaburcodes/pantheon-app/pulls/7","id":203035727,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzMDM1NzI3","html_url":"https://github.com/jaburcodes/pantheon-app/pull/7","diff_url":"https://github.com/jaburcodes/pantheon-app/pull/7.diff","patch_url":"https://github.com/jaburcodes/pantheon-app/pull/7.patch","issue_url":"https://api.github.com/repos/jaburcodes/pantheon-app/issues/7","number":7,"state":"closed","locked":false,"title":"fix:(address-input) - Get Geocode from an invalid Address (Address + …","user":{"login":"steniowagner","id":5205982,"node_id":"MDQ6VXNlcjUyMDU5ODI=","avatar_url":"https://avatars2.githubusercontent.com/u/5205982?v=4","gravatar_id":"","url":"https://api.github.com/users/steniowagner","html_url":"https://github.com/steniowagner","followers_url":"https://api.github.com/users/steniowagner/followers","following_url":"https://api.github.com/users/steniowagner/following{/other_user}","gists_url":"https://api.github.com/users/steniowagner/gists{/gist_id}","starred_url":"https://api.github.com/users/steniowagner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steniowagner/subscriptions","organizations_url":"https://api.github.com/users/steniowagner/orgs","repos_url":"https://api.github.com/users/steniowagner/repos","events_url":"https://api.github.com/users/steniowagner/events{/privacy}","received_events_url":"https://api.github.com/users/steniowagner/received_events","type":"User","site_admin":false},"body":"fix:(address-input) - Get Geocode from an invalid Address (Address + Number)","created_at":"2018-07-22T02:18:54Z","updated_at":"2018-07-22T02:40:39Z","closed_at":"2018-07-22T02:19:14Z","merged_at":"2018-07-22T02:19:14Z","merge_commit_sha":"29832b1e513f4540b625ba5749f0ad151a1b9ebb","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/jaburcodes/pantheon-app/pulls/7/commits","review_comments_url":"https://api.github.com/repos/jaburcodes/pantheon-app/pulls/7/comments","review_comment_url":"https://api.github.com/repos/jaburcodes/pantheon-app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jaburcodes/pantheon-app/issues/7/comments","statuses_url":"https://api.github.com/repos/jaburcodes/pantheon-app/statuses/c988136fe0ec33d2094d5a5c1a5c1fefad16f959","head":{"label":"jaburcodes:fix/address-input","ref":"fix/address-input","sha":"c988136fe0ec33d2094d5a5c1a5c1fefad16f959","user":{"login":"jaburcodes","id":13947203,"node_id":"MDQ6VXNlcjEzOTQ3MjAz","avatar_url":"https://avatars0.githubusercontent.com/u/13947203?v=4","gravatar_id":"","url":"https://api.github.com/users/jaburcodes","html_url":"https://github.com/jaburcodes","followers_url":"https://api.github.com/users/jaburcodes/followers","following_url":"https://api.github.com/users/jaburcodes/following{/other_user}","gists_url":"https://api.github.com/users/jaburcodes/gists{/gist_id}","starred_url":"https://api.github.com/users/jaburcodes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaburcodes/subscriptions","organizations_url":"https://api.github.com/users/jaburcodes/orgs","repos_url":"https://api.github.com/users/jaburcodes/repos","events_url":"https://api.github.com/users/jaburcodes/events{/privacy}","received_events_url":"https://api.github.com/users/jaburcodes/received_events","type":"User","site_admin":false},"repo":{"id":141433342,"node_id":"MDEwOlJlcG9zaXRvcnkxNDE0MzMzNDI=","name":"pantheon-app","full_name":"jaburcodes/pantheon-app","owner":{"login":"jaburcodes","id":13947203,"node_id":"MDQ6VXNlcjEzOTQ3MjAz","avatar_url":"https://avatars0.githubusercontent.com/u/13947203?v=4","gravatar_id":"","url":"https://api.github.com/users/jaburcodes","html_url":"https://github.com/jaburcodes","followers_url":"https://api.github.com/users/jaburcodes/followers","following_url":"https://api.github.com/users/jaburcodes/following{/other_user}","gists_url":"https://api.github.com/users/jaburcodes/gists{/gist_id}","starred_url":"https://api.github.com/users/jaburcodes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaburcodes/subscriptions","organizations_url":"https://api.github.com/users/jaburcodes/orgs","repos_url":"https://api.github.com/users/jaburcodes/repos","events_url":"https://api.github.com/users/jaburcodes/events{/privacy}","received_events_url":"https://api.github.com/users/jaburcodes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jaburcodes/pantheon-app","description":"🅿️React Native mobile app","fork":false,"url":"https://api.github.com/repos/jaburcodes/pantheon-app","forks_url":"https://api.github.com/repos/jaburcodes/pantheon-app/forks","keys_url":"https://api.github.com/repos/jaburcodes/pantheon-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jaburcodes/pantheon-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jaburcodes/pantheon-app/teams","hooks_url":"https://api.github.com/repos/jaburcodes/pantheon-app/hooks","issue_events_url":"https://api.github.com/repos/jaburcodes/pantheon-app/issues/events{/number}","events_url":"https://api.github.com/repos/jaburcodes/pantheon-app/events","assignees_url":"https://api.github.com/repos/jaburcodes/pantheon-app/assignees{/user}","branches_url":"https://api.github.com/repos/jaburcodes/pantheon-app/branches{/branch}","tags_url":"https://api.github.com/repos/jaburcodes/pantheon-app/tags","blobs_url":"https://api.github.com/repos/jaburcodes/pantheon-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jaburcodes/pantheon-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jaburcodes/pantheon-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/jaburcodes/pantheon-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jaburcodes/pantheon-app/statuses/{sha}","languages_url":"https://api.github.com/repos/jaburcodes/pantheon-app/languages","stargazers_url":"https://api.github.com/repos/jaburcodes/pantheon-app/stargazers","contributors_url":"https://api.github.com/repos/jaburcodes/pantheon-app/contributors","subscribers_url":"https://api.github.com/repos/jaburcodes/pantheon-app/subscribers","subscription_url":"https://api.github.com/repos/jaburcodes/pantheon-app/subscription","commits_url":"https://api.github.com/repos/jaburcodes/pantheon-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/jaburcodes/pantheon-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/jaburcodes/pantheon-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/jaburcodes/pantheon-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/jaburcodes/pantheon-app/contents/{+path}","compare_url":"https://api.github.com/repos/jaburcodes/pantheon-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jaburcodes/pantheon-app/merges","archive_url":"https://api.github.com/repos/jaburcodes/pantheon-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jaburcodes/pantheon-app/downloads","issues_url":"https://api.github.com/repos/jaburcodes/pantheon-app/issues{/number}","pulls_url":"https://api.github.com/repos/jaburcodes/pantheon-app/pulls{/number}","milestones_url":"https://api.github.com/repos/jaburcodes/pantheon-app/milestones{/number}","notifications_url":"https://api.github.com/repos/jaburcodes/pantheon-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jaburcodes/pantheon-app/labels{/name}","releases_url":"https://api.github.com/repos/jaburcodes/pantheon-app/releases{/id}","deployments_url":"https://api.github.com/repos/jaburcodes/pantheon-app/deployments","created_at":"2018-07-18T12:42:36Z","updated_at":"2018-07-22T02:19:15Z","pushed_at":"2018-07-22T02:19:14Z","git_url":"git://github.com/jaburcodes/pantheon-app.git","ssh_url":"git@github.com:jaburcodes/pantheon-app.git","clone_url":"https://github.com/jaburcodes/pantheon-app.git","svn_url":"https://github.com/jaburcodes/pantheon-app","homepage":"","size":1020,"stargazers_count":9,"watchers_count":9,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":2,"open_issues":4,"watchers":9,"default_branch":"master"}},"base":{"label":"jaburcodes:master","ref":"master","sha":"62b4b55488eb66b32e775ddadb2191bd13e57cfe","user":{"login":"jaburcodes","id":13947203,"node_id":"MDQ6VXNlcjEzOTQ3MjAz","avatar_url":"https://avatars0.githubusercontent.com/u/13947203?v=4","gravatar_id":"","url":"https://api.github.com/users/jaburcodes","html_url":"https://github.com/jaburcodes","followers_url":"https://api.github.com/users/jaburcodes/followers","following_url":"https://api.github.com/users/jaburcodes/following{/other_user}","gists_url":"https://api.github.com/users/jaburcodes/gists{/gist_id}","starred_url":"https://api.github.com/users/jaburcodes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaburcodes/subscriptions","organizations_url":"https://api.github.com/users/jaburcodes/orgs","repos_url":"https://api.github.com/users/jaburcodes/repos","events_url":"https://api.github.com/users/jaburcodes/events{/privacy}","received_events_url":"https://api.github.com/users/jaburcodes/received_events","type":"User","site_admin":false},"repo":{"id":141433342,"node_id":"MDEwOlJlcG9zaXRvcnkxNDE0MzMzNDI=","name":"pantheon-app","full_name":"jaburcodes/pantheon-app","owner":{"login":"jaburcodes","id":13947203,"node_id":"MDQ6VXNlcjEzOTQ3MjAz","avatar_url":"https://avatars0.githubusercontent.com/u/13947203?v=4","gravatar_id":"","url":"https://api.github.com/users/jaburcodes","html_url":"https://github.com/jaburcodes","followers_url":"https://api.github.com/users/jaburcodes/followers","following_url":"https://api.github.com/users/jaburcodes/following{/other_user}","gists_url":"https://api.github.com/users/jaburcodes/gists{/gist_id}","starred_url":"https://api.github.com/users/jaburcodes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaburcodes/subscriptions","organizations_url":"https://api.github.com/users/jaburcodes/orgs","repos_url":"https://api.github.com/users/jaburcodes/repos","events_url":"https://api.github.com/users/jaburcodes/events{/privacy}","received_events_url":"https://api.github.com/users/jaburcodes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jaburcodes/pantheon-app","description":"🅿️React Native mobile app","fork":false,"url":"https://api.github.com/repos/jaburcodes/pantheon-app","forks_url":"https://api.github.com/repos/jaburcodes/pantheon-app/forks","keys_url":"https://api.github.com/repos/jaburcodes/pantheon-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jaburcodes/pantheon-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jaburcodes/pantheon-app/teams","hooks_url":"https://api.github.com/repos/jaburcodes/pantheon-app/hooks","issue_events_url":"https://api.github.com/repos/jaburcodes/pantheon-app/issues/events{/number}","events_url":"https://api.github.com/repos/jaburcodes/pantheon-app/events","assignees_url":"https://api.github.com/repos/jaburcodes/pantheon-app/assignees{/user}","branches_url":"https://api.github.com/repos/jaburcodes/pantheon-app/branches{/branch}","tags_url":"https://api.github.com/repos/jaburcodes/pantheon-app/tags","blobs_url":"https://api.github.com/repos/jaburcodes/pantheon-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jaburcodes/pantheon-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jaburcodes/pantheon-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/jaburcodes/pantheon-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jaburcodes/pantheon-app/statuses/{sha}","languages_url":"https://api.github.com/repos/jaburcodes/pantheon-app/languages","stargazers_url":"https://api.github.com/repos/jaburcodes/pantheon-app/stargazers","contributors_url":"https://api.github.com/repos/jaburcodes/pantheon-app/contributors","subscribers_url":"https://api.github.com/repos/jaburcodes/pantheon-app/subscribers","subscription_url":"https://api.github.com/repos/jaburcodes/pantheon-app/subscription","commits_url":"https://api.github.com/repos/jaburcodes/pantheon-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/jaburcodes/pantheon-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/jaburcodes/pantheon-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/jaburcodes/pantheon-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/jaburcodes/pantheon-app/contents/{+path}","compare_url":"https://api.github.com/repos/jaburcodes/pantheon-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jaburcodes/pantheon-app/merges","archive_url":"https://api.github.com/repos/jaburcodes/pantheon-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jaburcodes/pantheon-app/downloads","issues_url":"https://api.github.com/repos/jaburcodes/pantheon-app/issues{/number}","pulls_url":"https://api.github.com/repos/jaburcodes/pantheon-app/pulls{/number}","milestones_url":"https://api.github.com/repos/jaburcodes/pantheon-app/milestones{/number}","notifications_url":"https://api.github.com/repos/jaburcodes/pantheon-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jaburcodes/pantheon-app/labels{/name}","releases_url":"https://api.github.com/repos/jaburcodes/pantheon-app/releases{/id}","deployments_url":"https://api.github.com/repos/jaburcodes/pantheon-app/deployments","created_at":"2018-07-18T12:42:36Z","updated_at":"2018-07-22T02:19:15Z","pushed_at":"2018-07-22T02:19:14Z","git_url":"git://github.com/jaburcodes/pantheon-app.git","ssh_url":"git@github.com:jaburcodes/pantheon-app.git","clone_url":"https://github.com/jaburcodes/pantheon-app.git","svn_url":"https://github.com/jaburcodes/pantheon-app","homepage":"","size":1020,"stargazers_count":9,"watchers_count":9,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":2,"open_issues":4,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jaburcodes/pantheon-app/pulls/7"},"html":{"href":"https://github.com/jaburcodes/pantheon-app/pull/7"},"issue":{"href":"https://api.github.com/repos/jaburcodes/pantheon-app/issues/7"},"comments":{"href":"https://api.github.com/repos/jaburcodes/pantheon-app/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/jaburcodes/pantheon-app/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/jaburcodes/pantheon-app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jaburcodes/pantheon-app/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/jaburcodes/pantheon-app/statuses/c988136fe0ec33d2094d5a5c1a5c1fefad16f959"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"jaburcodes"}}