{"action":"created","comment":{"url":"https://api.github.com/repos/jonnyjava/auto-repair-child/pulls/comments/60693808","id":60693808,"diff_hunk":"@@ -1,4 +1,37 @@\n function submit_onboarding_form(){\n+  save_demand_remotely();\n+  save_demand_locally();\n+}\n+\n+function save_demand_remotely(){\n+  var submitted_datas = {demand : build_demand_json()};\n+  $.ajax({\n+    type: 'POST',\n+    data: JSON.stringify(submitted_datas),\n+    contentType: 'application/json; charset=utf-8',\n+    dataType: 'json',\n+    headers: {\n+      Authorization: 'Token token='+api_auth_token\n+    },\n+    url: api_url+'/demands',\n+    async: true\n+  }).always(function(response){\n+    console.log(response);\n+  });\n+}\n+\n+function build_demand_json(){\n+  var demand = {};\n+  var form_content = $('#onboarding_form').serializeArray();\n+  $.each(form_content, function(){\n+    demand[this.name] = this.value;\n+  });\n+  demand['city'] = demand['user_city'];","path":"assets/js/123onboarding_form_submit.js","position":29,"original_position":29,"commit_id":"f9e990419bd2e85ce385abca536f1dbe870642b7","original_commit_id":"f9e990419bd2e85ce385abca536f1dbe870642b7","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.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":"['city'] is better written in dot notation.<br>['user_city'] is better written in dot notation.","created_at":"2016-04-22T05:53:22Z","updated_at":"2016-04-22T05:53:22Z","html_url":"https://github.com/jonnyjava/auto-repair-child/pull/28#discussion_r60693808","pull_request_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/pulls/28","_links":{"self":{"href":"https://api.github.com/repos/jonnyjava/auto-repair-child/pulls/comments/60693808"},"html":{"href":"https://github.com/jonnyjava/auto-repair-child/pull/28#discussion_r60693808"},"pull_request":{"href":"https://api.github.com/repos/jonnyjava/auto-repair-child/pulls/28"}}},"pull_request":{"url":"https://api.github.com/repos/jonnyjava/auto-repair-child/pulls/28","id":65416248,"html_url":"https://github.com/jonnyjava/auto-repair-child/pull/28","diff_url":"https://github.com/jonnyjava/auto-repair-child/pull/28.diff","patch_url":"https://github.com/jonnyjava/auto-repair-child/pull/28.patch","issue_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/issues/28","number":28,"state":"open","locked":false,"title":"Demand creation via api","user":{"login":"jonnyjava","id":3618983,"avatar_url":"https://avatars.githubusercontent.com/u/3618983?v=3","gravatar_id":"","url":"https://api.github.com/users/jonnyjava","html_url":"https://github.com/jonnyjava","followers_url":"https://api.github.com/users/jonnyjava/followers","following_url":"https://api.github.com/users/jonnyjava/following{/other_user}","gists_url":"https://api.github.com/users/jonnyjava/gists{/gist_id}","starred_url":"https://api.github.com/users/jonnyjava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonnyjava/subscriptions","organizations_url":"https://api.github.com/users/jonnyjava/orgs","repos_url":"https://api.github.com/users/jonnyjava/repos","events_url":"https://api.github.com/users/jonnyjava/events{/privacy}","received_events_url":"https://api.github.com/users/jonnyjava/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-06T06:34:28Z","updated_at":"2016-04-22T05:53:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b50ef65d53efc5106f9785cb41239f6ea20907f0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/pulls/28/commits","review_comments_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/pulls/28/comments","review_comment_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/issues/28/comments","statuses_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/statuses/f9e990419bd2e85ce385abca536f1dbe870642b7","head":{"label":"jonnyjava:demand_creation_via_api","ref":"demand_creation_via_api","sha":"f9e990419bd2e85ce385abca536f1dbe870642b7","user":{"login":"jonnyjava","id":3618983,"avatar_url":"https://avatars.githubusercontent.com/u/3618983?v=3","gravatar_id":"","url":"https://api.github.com/users/jonnyjava","html_url":"https://github.com/jonnyjava","followers_url":"https://api.github.com/users/jonnyjava/followers","following_url":"https://api.github.com/users/jonnyjava/following{/other_user}","gists_url":"https://api.github.com/users/jonnyjava/gists{/gist_id}","starred_url":"https://api.github.com/users/jonnyjava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonnyjava/subscriptions","organizations_url":"https://api.github.com/users/jonnyjava/orgs","repos_url":"https://api.github.com/users/jonnyjava/repos","events_url":"https://api.github.com/users/jonnyjava/events{/privacy}","received_events_url":"https://api.github.com/users/jonnyjava/received_events","type":"User","site_admin":false},"repo":{"id":48102274,"name":"auto-repair-child","full_name":"jonnyjava/auto-repair-child","owner":{"login":"jonnyjava","id":3618983,"avatar_url":"https://avatars.githubusercontent.com/u/3618983?v=3","gravatar_id":"","url":"https://api.github.com/users/jonnyjava","html_url":"https://github.com/jonnyjava","followers_url":"https://api.github.com/users/jonnyjava/followers","following_url":"https://api.github.com/users/jonnyjava/following{/other_user}","gists_url":"https://api.github.com/users/jonnyjava/gists{/gist_id}","starred_url":"https://api.github.com/users/jonnyjava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonnyjava/subscriptions","organizations_url":"https://api.github.com/users/jonnyjava/orgs","repos_url":"https://api.github.com/users/jonnyjava/repos","events_url":"https://api.github.com/users/jonnyjava/events{/privacy}","received_events_url":"https://api.github.com/users/jonnyjava/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jonnyjava/auto-repair-child","description":"Custom child theme for wordpress","fork":false,"url":"https://api.github.com/repos/jonnyjava/auto-repair-child","forks_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/forks","keys_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/teams","hooks_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/hooks","issue_events_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/issues/events{/number}","events_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/events","assignees_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/assignees{/user}","branches_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/branches{/branch}","tags_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/tags","blobs_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/git/refs{/sha}","trees_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/statuses/{sha}","languages_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/languages","stargazers_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/stargazers","contributors_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/contributors","subscribers_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/subscribers","subscription_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/subscription","commits_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/commits{/sha}","git_commits_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/git/commits{/sha}","comments_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/comments{/number}","issue_comment_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/issues/comments{/number}","contents_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/contents/{+path}","compare_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/merges","archive_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/downloads","issues_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/issues{/number}","pulls_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/pulls{/number}","milestones_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/milestones{/number}","notifications_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/labels{/name}","releases_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/releases{/id}","deployments_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/deployments","created_at":"2015-12-16T10:01:05Z","updated_at":"2016-01-15T10:17:33Z","pushed_at":"2016-04-22T05:53:14Z","git_url":"git://github.com/jonnyjava/auto-repair-child.git","ssh_url":"git@github.com:jonnyjava/auto-repair-child.git","clone_url":"https://github.com/jonnyjava/auto-repair-child.git","svn_url":"https://github.com/jonnyjava/auto-repair-child","homepage":null,"size":2120,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":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":"jonnyjava:master","ref":"master","sha":"8aac088596a390c63b93e1d269229c80d3f70ba5","user":{"login":"jonnyjava","id":3618983,"avatar_url":"https://avatars.githubusercontent.com/u/3618983?v=3","gravatar_id":"","url":"https://api.github.com/users/jonnyjava","html_url":"https://github.com/jonnyjava","followers_url":"https://api.github.com/users/jonnyjava/followers","following_url":"https://api.github.com/users/jonnyjava/following{/other_user}","gists_url":"https://api.github.com/users/jonnyjava/gists{/gist_id}","starred_url":"https://api.github.com/users/jonnyjava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonnyjava/subscriptions","organizations_url":"https://api.github.com/users/jonnyjava/orgs","repos_url":"https://api.github.com/users/jonnyjava/repos","events_url":"https://api.github.com/users/jonnyjava/events{/privacy}","received_events_url":"https://api.github.com/users/jonnyjava/received_events","type":"User","site_admin":false},"repo":{"id":48102274,"name":"auto-repair-child","full_name":"jonnyjava/auto-repair-child","owner":{"login":"jonnyjava","id":3618983,"avatar_url":"https://avatars.githubusercontent.com/u/3618983?v=3","gravatar_id":"","url":"https://api.github.com/users/jonnyjava","html_url":"https://github.com/jonnyjava","followers_url":"https://api.github.com/users/jonnyjava/followers","following_url":"https://api.github.com/users/jonnyjava/following{/other_user}","gists_url":"https://api.github.com/users/jonnyjava/gists{/gist_id}","starred_url":"https://api.github.com/users/jonnyjava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonnyjava/subscriptions","organizations_url":"https://api.github.com/users/jonnyjava/orgs","repos_url":"https://api.github.com/users/jonnyjava/repos","events_url":"https://api.github.com/users/jonnyjava/events{/privacy}","received_events_url":"https://api.github.com/users/jonnyjava/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jonnyjava/auto-repair-child","description":"Custom child theme for wordpress","fork":false,"url":"https://api.github.com/repos/jonnyjava/auto-repair-child","forks_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/forks","keys_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/teams","hooks_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/hooks","issue_events_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/issues/events{/number}","events_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/events","assignees_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/assignees{/user}","branches_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/branches{/branch}","tags_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/tags","blobs_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/git/refs{/sha}","trees_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/statuses/{sha}","languages_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/languages","stargazers_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/stargazers","contributors_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/contributors","subscribers_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/subscribers","subscription_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/subscription","commits_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/commits{/sha}","git_commits_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/git/commits{/sha}","comments_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/comments{/number}","issue_comment_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/issues/comments{/number}","contents_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/contents/{+path}","compare_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/merges","archive_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/downloads","issues_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/issues{/number}","pulls_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/pulls{/number}","milestones_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/milestones{/number}","notifications_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/labels{/name}","releases_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/releases{/id}","deployments_url":"https://api.github.com/repos/jonnyjava/auto-repair-child/deployments","created_at":"2015-12-16T10:01:05Z","updated_at":"2016-01-15T10:17:33Z","pushed_at":"2016-04-22T05:53:14Z","git_url":"git://github.com/jonnyjava/auto-repair-child.git","ssh_url":"git@github.com:jonnyjava/auto-repair-child.git","clone_url":"https://github.com/jonnyjava/auto-repair-child.git","svn_url":"https://github.com/jonnyjava/auto-repair-child","homepage":null,"size":2120,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":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/jonnyjava/auto-repair-child/pulls/28"},"html":{"href":"https://github.com/jonnyjava/auto-repair-child/pull/28"},"issue":{"href":"https://api.github.com/repos/jonnyjava/auto-repair-child/issues/28"},"comments":{"href":"https://api.github.com/repos/jonnyjava/auto-repair-child/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/jonnyjava/auto-repair-child/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/jonnyjava/auto-repair-child/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jonnyjava/auto-repair-child/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/jonnyjava/auto-repair-child/statuses/f9e990419bd2e85ce385abca536f1dbe870642b7"}}}}