{"action":"created","comment":{"url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/pulls/comments/89972234","pull_request_review_id":10497901,"id":89972234,"diff_hunk":"@@ -241,43 +246,39 @@ decodeRecord =\n         (field \"last_modified\" int)\n \n \n-sendFormData : Form.Model -> Cmd Msg\n-sendFormData formData =\n-    -- TODO: handle auth with provided credentials\n+sendFormData : Model -> Form.Model -> Cmd Msg\n+sendFormData model formData =\n     let\n-        rootUrl =\n-            \"https://kinto.dev.mozaws.net/v1/buckets/default/collections/test-items/records\"\n-\n-        ( method, url, responseMsg ) =\n-            case formData.id of\n-                Nothing ->\n-                    ( HttpBuilder.post, rootUrl, CreateRecordResponse )\n-\n-                Just id ->\n-                    ( HttpBuilder.patch, rootUrl ++ \"/\" ++ id, EditRecordResponse )\n-\n-        request =\n-            method url\n-                |> withHeader \"Authorization\" \"Basic dGVzdDp0ZXN0\"\n-                |> withJsonBody (encodeFormData formData)\n-                |> withExpect (Http.expectJson (field \"data\" decodeRecord))\n+        data =\n+            encodeFormData formData\n     in\n-        HttpBuilder.send responseMsg request\n-\n-\n-deleteRecord : RecordId -> Cmd Msg\n-deleteRecord recordId =\n-    -- TODO: handle auth with provided credentials\n-    let\n-        delete_url =\n-            \"https://kinto.dev.mozaws.net/v1/buckets/default/collections/test-items/records/\" ++ recordId\n-\n-        request =\n-            HttpBuilder.delete delete_url\n-                |> withHeader \"Authorization\" \"Basic dGVzdDp0ZXN0\"\n-                |> withExpect (Http.expectJson (field \"data\" decodeRecord))\n-    in\n-        HttpBuilder.send DeleteRecordResponse request\n+        case formData.id of\n+            Nothing ->\n+                Kinto.createRecord\n+                    model.kintoConfig\n+                    \"default\"\n+                    \"test-items\"\n+                    data\n+                    CreateRecordResponse\n+\n+            Just recordId ->\n+                Kinto.updateRecord\n+                    model.kintoConfig\n+                    \"default\"\n+                    \"test-items\"\n+                    recordId\n+                    data\n+                    EditRecordResponse","path":"src/Model.elm","position":115,"original_position":115,"commit_id":"2a819e727cf320e3e9fb804bc20f29b78a24d7b4","original_commit_id":"2a819e727cf320e3e9fb804bc20f29b78a24d7b4","user":{"login":"magopian","id":167767,"avatar_url":"https://avatars.githubusercontent.com/u/167767?v=3","gravatar_id":"","url":"https://api.github.com/users/magopian","html_url":"https://github.com/magopian","followers_url":"https://api.github.com/users/magopian/followers","following_url":"https://api.github.com/users/magopian/following{/other_user}","gists_url":"https://api.github.com/users/magopian/gists{/gist_id}","starred_url":"https://api.github.com/users/magopian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magopian/subscriptions","organizations_url":"https://api.github.com/users/magopian/orgs","repos_url":"https://api.github.com/users/magopian/repos","events_url":"https://api.github.com/users/magopian/events{/privacy}","received_events_url":"https://api.github.com/users/magopian/received_events","type":"User","site_admin":false},"body":"Not sure if it's a common Elm idiom, or if it could/should be improved, will revisit this later, thanks!","created_at":"2016-11-29T09:42:15Z","updated_at":"2016-11-29T09:42:16Z","html_url":"https://github.com/Kinto/kinto-elm-experiments/pull/15#discussion_r89972234","pull_request_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/Kinto/kinto-elm-experiments/pulls/comments/89972234"},"html":{"href":"https://github.com/Kinto/kinto-elm-experiments/pull/15#discussion_r89972234"},"pull_request":{"href":"https://api.github.com/repos/Kinto/kinto-elm-experiments/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/pulls/15","id":95522775,"html_url":"https://github.com/Kinto/kinto-elm-experiments/pull/15","diff_url":"https://github.com/Kinto/kinto-elm-experiments/pull/15.diff","patch_url":"https://github.com/Kinto/kinto-elm-experiments/pull/15.patch","issue_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/issues/15","number":15,"state":"open","locked":false,"title":"Add some more high level APIs","user":{"login":"magopian","id":167767,"avatar_url":"https://avatars.githubusercontent.com/u/167767?v=3","gravatar_id":"","url":"https://api.github.com/users/magopian","html_url":"https://github.com/magopian","followers_url":"https://api.github.com/users/magopian/followers","following_url":"https://api.github.com/users/magopian/following{/other_user}","gists_url":"https://api.github.com/users/magopian/gists{/gist_id}","starred_url":"https://api.github.com/users/magopian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magopian/subscriptions","organizations_url":"https://api.github.com/users/magopian/orgs","repos_url":"https://api.github.com/users/magopian/repos","events_url":"https://api.github.com/users/magopian/events{/privacy}","received_events_url":"https://api.github.com/users/magopian/received_events","type":"User","site_admin":false},"body":"- [x] Create (POST)\r\n- [x] Replace (PUT)\r\n- [x] Update (PATCH)\r\n- [x] Delete (DELETE)\r\n\r\nPlease keep in mind that only a small part of the API is exercised in the experiment (for example, the update APIs aren't used at all, and for the others, only the APIs for records are used). So it's highly possible that something isn't working properly.\r\n\r\n@n1k0 @Natim thoughts?","created_at":"2016-11-28T15:46:33Z","updated_at":"2016-11-29T09:42:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bfb0be4619c6546771fad57065933f420265aab2","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/pulls/15/commits","review_comments_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/pulls/15/comments","review_comment_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/issues/15/comments","statuses_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/statuses/2a819e727cf320e3e9fb804bc20f29b78a24d7b4","head":{"label":"Kinto:complete-high-level-API","ref":"complete-high-level-API","sha":"2a819e727cf320e3e9fb804bc20f29b78a24d7b4","user":{"login":"Kinto","id":13413813,"avatar_url":"https://avatars.githubusercontent.com/u/13413813?v=3","gravatar_id":"","url":"https://api.github.com/users/Kinto","html_url":"https://github.com/Kinto","followers_url":"https://api.github.com/users/Kinto/followers","following_url":"https://api.github.com/users/Kinto/following{/other_user}","gists_url":"https://api.github.com/users/Kinto/gists{/gist_id}","starred_url":"https://api.github.com/users/Kinto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kinto/subscriptions","organizations_url":"https://api.github.com/users/Kinto/orgs","repos_url":"https://api.github.com/users/Kinto/repos","events_url":"https://api.github.com/users/Kinto/events{/privacy}","received_events_url":"https://api.github.com/users/Kinto/received_events","type":"Organization","site_admin":false},"repo":{"id":68020486,"name":"kinto-elm-experiments","full_name":"Kinto/kinto-elm-experiments","owner":{"login":"Kinto","id":13413813,"avatar_url":"https://avatars.githubusercontent.com/u/13413813?v=3","gravatar_id":"","url":"https://api.github.com/users/Kinto","html_url":"https://github.com/Kinto","followers_url":"https://api.github.com/users/Kinto/followers","following_url":"https://api.github.com/users/Kinto/following{/other_user}","gists_url":"https://api.github.com/users/Kinto/gists{/gist_id}","starred_url":"https://api.github.com/users/Kinto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kinto/subscriptions","organizations_url":"https://api.github.com/users/Kinto/orgs","repos_url":"https://api.github.com/users/Kinto/repos","events_url":"https://api.github.com/users/Kinto/events{/privacy}","received_events_url":"https://api.github.com/users/Kinto/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Kinto/kinto-elm-experiments","description":"Experimenting with Elm and the Kinto API","fork":false,"url":"https://api.github.com/repos/Kinto/kinto-elm-experiments","forks_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/forks","keys_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/teams","hooks_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/hooks","issue_events_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/issues/events{/number}","events_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/events","assignees_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/assignees{/user}","branches_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/branches{/branch}","tags_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/tags","blobs_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/git/refs{/sha}","trees_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/statuses/{sha}","languages_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/languages","stargazers_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/stargazers","contributors_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/contributors","subscribers_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/subscribers","subscription_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/subscription","commits_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/commits{/sha}","git_commits_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/git/commits{/sha}","comments_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/comments{/number}","issue_comment_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/issues/comments{/number}","contents_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/contents/{+path}","compare_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/merges","archive_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/downloads","issues_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/issues{/number}","pulls_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/pulls{/number}","milestones_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/milestones{/number}","notifications_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/labels{/name}","releases_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/releases{/id}","deployments_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/deployments","created_at":"2016-09-12T15:13:15Z","updated_at":"2016-11-28T09:23:44Z","pushed_at":"2016-11-28T18:09:51Z","git_url":"git://github.com/Kinto/kinto-elm-experiments.git","ssh_url":"git@github.com:Kinto/kinto-elm-experiments.git","clone_url":"https://github.com/Kinto/kinto-elm-experiments.git","svn_url":"https://github.com/Kinto/kinto-elm-experiments","homepage":"https://Kinto.github.io/kinto-elm-experiments/","size":170,"stargazers_count":1,"watchers_count":1,"language":"Elm","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"Kinto:master","ref":"master","sha":"169e1f13438d3ae452cc4c95109fb42b015d310a","user":{"login":"Kinto","id":13413813,"avatar_url":"https://avatars.githubusercontent.com/u/13413813?v=3","gravatar_id":"","url":"https://api.github.com/users/Kinto","html_url":"https://github.com/Kinto","followers_url":"https://api.github.com/users/Kinto/followers","following_url":"https://api.github.com/users/Kinto/following{/other_user}","gists_url":"https://api.github.com/users/Kinto/gists{/gist_id}","starred_url":"https://api.github.com/users/Kinto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kinto/subscriptions","organizations_url":"https://api.github.com/users/Kinto/orgs","repos_url":"https://api.github.com/users/Kinto/repos","events_url":"https://api.github.com/users/Kinto/events{/privacy}","received_events_url":"https://api.github.com/users/Kinto/received_events","type":"Organization","site_admin":false},"repo":{"id":68020486,"name":"kinto-elm-experiments","full_name":"Kinto/kinto-elm-experiments","owner":{"login":"Kinto","id":13413813,"avatar_url":"https://avatars.githubusercontent.com/u/13413813?v=3","gravatar_id":"","url":"https://api.github.com/users/Kinto","html_url":"https://github.com/Kinto","followers_url":"https://api.github.com/users/Kinto/followers","following_url":"https://api.github.com/users/Kinto/following{/other_user}","gists_url":"https://api.github.com/users/Kinto/gists{/gist_id}","starred_url":"https://api.github.com/users/Kinto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kinto/subscriptions","organizations_url":"https://api.github.com/users/Kinto/orgs","repos_url":"https://api.github.com/users/Kinto/repos","events_url":"https://api.github.com/users/Kinto/events{/privacy}","received_events_url":"https://api.github.com/users/Kinto/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Kinto/kinto-elm-experiments","description":"Experimenting with Elm and the Kinto API","fork":false,"url":"https://api.github.com/repos/Kinto/kinto-elm-experiments","forks_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/forks","keys_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/teams","hooks_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/hooks","issue_events_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/issues/events{/number}","events_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/events","assignees_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/assignees{/user}","branches_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/branches{/branch}","tags_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/tags","blobs_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/git/refs{/sha}","trees_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/statuses/{sha}","languages_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/languages","stargazers_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/stargazers","contributors_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/contributors","subscribers_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/subscribers","subscription_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/subscription","commits_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/commits{/sha}","git_commits_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/git/commits{/sha}","comments_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/comments{/number}","issue_comment_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/issues/comments{/number}","contents_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/contents/{+path}","compare_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/merges","archive_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/downloads","issues_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/issues{/number}","pulls_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/pulls{/number}","milestones_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/milestones{/number}","notifications_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/labels{/name}","releases_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/releases{/id}","deployments_url":"https://api.github.com/repos/Kinto/kinto-elm-experiments/deployments","created_at":"2016-09-12T15:13:15Z","updated_at":"2016-11-28T09:23:44Z","pushed_at":"2016-11-28T18:09:51Z","git_url":"git://github.com/Kinto/kinto-elm-experiments.git","ssh_url":"git@github.com:Kinto/kinto-elm-experiments.git","clone_url":"https://github.com/Kinto/kinto-elm-experiments.git","svn_url":"https://github.com/Kinto/kinto-elm-experiments","homepage":"https://Kinto.github.io/kinto-elm-experiments/","size":170,"stargazers_count":1,"watchers_count":1,"language":"Elm","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Kinto/kinto-elm-experiments/pulls/15"},"html":{"href":"https://github.com/Kinto/kinto-elm-experiments/pull/15"},"issue":{"href":"https://api.github.com/repos/Kinto/kinto-elm-experiments/issues/15"},"comments":{"href":"https://api.github.com/repos/Kinto/kinto-elm-experiments/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/Kinto/kinto-elm-experiments/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/Kinto/kinto-elm-experiments/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Kinto/kinto-elm-experiments/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/Kinto/kinto-elm-experiments/statuses/2a819e727cf320e3e9fb804bc20f29b78a24d7b4"}}}}
{"actor":{"display_login":"magopian"}}