{"action":"created","comment":{"url":"https://api.github.com/repos/marmelab/javascript-boilerplate/pulls/comments/54387268","id":54387268,"diff_hunk":"@@ -23,15 +25,33 @@ app.use(function* getUser(next) {\n \n app.use(function* setQueries(next) {\n     this.orderQueries = orderFactory(this.client);\n+    this.productQueries = productFactory(this.client);\n \n     yield next;\n });\n \n app.use(koaRoute.post('/', function* postUserOrder(next) {\n-    this.data = yield coBody(this);\n-    this.data.reference = uuid.v1();\n-    this.data.customer_id = this.userData.id;\n-    this.data.date = new Date();\n+    const orderData = yield coBody(this);\n+    const productQueries = this.productQueries;\n+    const products = yield orderData.products.map(co.wrap(function* getProduct(p) {","path":"src/api/orders/orderApiRoutes.js","position":30,"original_position":30,"commit_id":"fb16807c75b07a6750194fb67bcc6c3864a15f6f","original_commit_id":"fb16807c75b07a6750194fb67bcc6c3864a15f6f","user":{"login":"Kmaschta","id":1819833,"avatar_url":"https://avatars.githubusercontent.com/u/1819833?v=3","gravatar_id":"","url":"https://api.github.com/users/Kmaschta","html_url":"https://github.com/Kmaschta","followers_url":"https://api.github.com/users/Kmaschta/followers","following_url":"https://api.github.com/users/Kmaschta/following{/other_user}","gists_url":"https://api.github.com/users/Kmaschta/gists{/gist_id}","starred_url":"https://api.github.com/users/Kmaschta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kmaschta/subscriptions","organizations_url":"https://api.github.com/users/Kmaschta/orgs","repos_url":"https://api.github.com/users/Kmaschta/repos","events_url":"https://api.github.com/users/Kmaschta/events{/privacy}","received_events_url":"https://api.github.com/users/Kmaschta/received_events","type":"User","site_admin":false},"body":"Why do you use a `co.wrap` if you're already in a generator ?\r\nI don't get it.","created_at":"2016-02-29T09:44:29Z","updated_at":"2016-02-29T09:44:29Z","html_url":"https://github.com/marmelab/javascript-boilerplate/pull/36#discussion_r54387268","pull_request_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/pulls/36","_links":{"self":{"href":"https://api.github.com/repos/marmelab/javascript-boilerplate/pulls/comments/54387268"},"html":{"href":"https://github.com/marmelab/javascript-boilerplate/pull/36#discussion_r54387268"},"pull_request":{"href":"https://api.github.com/repos/marmelab/javascript-boilerplate/pulls/36"}}},"pull_request":{"url":"https://api.github.com/repos/marmelab/javascript-boilerplate/pulls/36","id":59982088,"html_url":"https://github.com/marmelab/javascript-boilerplate/pull/36","diff_url":"https://github.com/marmelab/javascript-boilerplate/pull/36.diff","patch_url":"https://github.com/marmelab/javascript-boilerplate/pull/36.patch","issue_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/issues/36","number":36,"state":"open","locked":false,"title":"[RFR] Order a product","user":{"login":"djhi","id":1122076,"avatar_url":"https://avatars.githubusercontent.com/u/1122076?v=3","gravatar_id":"","url":"https://api.github.com/users/djhi","html_url":"https://github.com/djhi","followers_url":"https://api.github.com/users/djhi/followers","following_url":"https://api.github.com/users/djhi/following{/other_user}","gists_url":"https://api.github.com/users/djhi/gists{/gist_id}","starred_url":"https://api.github.com/users/djhi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djhi/subscriptions","organizations_url":"https://api.github.com/users/djhi/orgs","repos_url":"https://api.github.com/users/djhi/repos","events_url":"https://api.github.com/users/djhi/events{/privacy}","received_events_url":"https://api.github.com/users/djhi/received_events","type":"User","site_admin":false},"body":"- [x] ShoppingCart (client side only, not persistent)\r\n_It might be interesting to persist a shoppingcart in localstorage_\r\n![shoppingcart](https://sc-cdn.scaleengine.net/i/cfc348c35b4b4c870dd3a0f213a9041c.png)\r\n\r\n- [x] New order in API (save order items, etc.)\r\n![orders](https://sc-cdn.scaleengine.net/i/7f88041ad0476dba0a6108c1f0cf437b1.png)\r\n![order](https://sc-cdn.scaleengine.net/i/0b5267de68881581ae4b6e06325b8dbd.png)\r\n\r\n- [x] shoppingcart is cleared after an order has been created from it\r\n","created_at":"2016-02-19T17:41:37Z","updated_at":"2016-02-29T09:44:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8009a16ec0808d3081b73568f6445a5935ccd10e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/pulls/36/commits","review_comments_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/pulls/36/comments","review_comment_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/pulls/comments{/number}","comments_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/issues/36/comments","statuses_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/statuses/fb16807c75b07a6750194fb67bcc6c3864a15f6f","head":{"label":"marmelab:frontend-new-order","ref":"frontend-new-order","sha":"fb16807c75b07a6750194fb67bcc6c3864a15f6f","user":{"login":"marmelab","id":3116319,"avatar_url":"https://avatars.githubusercontent.com/u/3116319?v=3","gravatar_id":"","url":"https://api.github.com/users/marmelab","html_url":"https://github.com/marmelab","followers_url":"https://api.github.com/users/marmelab/followers","following_url":"https://api.github.com/users/marmelab/following{/other_user}","gists_url":"https://api.github.com/users/marmelab/gists{/gist_id}","starred_url":"https://api.github.com/users/marmelab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marmelab/subscriptions","organizations_url":"https://api.github.com/users/marmelab/orgs","repos_url":"https://api.github.com/users/marmelab/repos","events_url":"https://api.github.com/users/marmelab/events{/privacy}","received_events_url":"https://api.github.com/users/marmelab/received_events","type":"Organization","site_admin":false},"repo":{"id":49864754,"name":"javascript-boilerplate","full_name":"marmelab/javascript-boilerplate","owner":{"login":"marmelab","id":3116319,"avatar_url":"https://avatars.githubusercontent.com/u/3116319?v=3","gravatar_id":"","url":"https://api.github.com/users/marmelab","html_url":"https://github.com/marmelab","followers_url":"https://api.github.com/users/marmelab/followers","following_url":"https://api.github.com/users/marmelab/following{/other_user}","gists_url":"https://api.github.com/users/marmelab/gists{/gist_id}","starred_url":"https://api.github.com/users/marmelab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marmelab/subscriptions","organizations_url":"https://api.github.com/users/marmelab/orgs","repos_url":"https://api.github.com/users/marmelab/repos","events_url":"https://api.github.com/users/marmelab/events{/privacy}","received_events_url":"https://api.github.com/users/marmelab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/marmelab/javascript-boilerplate","description":"Node.js+Koa.js+PostgreSQL+React.js+Webpack+Mocha+Makefile, a starter kit for new apps","fork":false,"url":"https://api.github.com/repos/marmelab/javascript-boilerplate","forks_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/forks","keys_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/teams","hooks_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/hooks","issue_events_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/issues/events{/number}","events_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/events","assignees_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/assignees{/user}","branches_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/branches{/branch}","tags_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/tags","blobs_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/git/refs{/sha}","trees_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/statuses/{sha}","languages_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/languages","stargazers_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/stargazers","contributors_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/contributors","subscribers_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/subscribers","subscription_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/subscription","commits_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/commits{/sha}","git_commits_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/git/commits{/sha}","comments_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/comments{/number}","issue_comment_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/issues/comments{/number}","contents_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/contents/{+path}","compare_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/merges","archive_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/downloads","issues_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/issues{/number}","pulls_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/pulls{/number}","milestones_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/milestones{/number}","notifications_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/labels{/name}","releases_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/releases{/id}","deployments_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/deployments","created_at":"2016-01-18T09:05:11Z","updated_at":"2016-02-26T08:15:54Z","pushed_at":"2016-02-29T09:27:51Z","git_url":"git://github.com/marmelab/javascript-boilerplate.git","ssh_url":"git@github.com:marmelab/javascript-boilerplate.git","clone_url":"https://github.com/marmelab/javascript-boilerplate.git","svn_url":"https://github.com/marmelab/javascript-boilerplate","homepage":null,"size":223,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":6,"forks":1,"open_issues":6,"watchers":5,"default_branch":"master"}},"base":{"label":"marmelab:master","ref":"master","sha":"b5fe6858940ab355ca20862993bdde46743cb56f","user":{"login":"marmelab","id":3116319,"avatar_url":"https://avatars.githubusercontent.com/u/3116319?v=3","gravatar_id":"","url":"https://api.github.com/users/marmelab","html_url":"https://github.com/marmelab","followers_url":"https://api.github.com/users/marmelab/followers","following_url":"https://api.github.com/users/marmelab/following{/other_user}","gists_url":"https://api.github.com/users/marmelab/gists{/gist_id}","starred_url":"https://api.github.com/users/marmelab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marmelab/subscriptions","organizations_url":"https://api.github.com/users/marmelab/orgs","repos_url":"https://api.github.com/users/marmelab/repos","events_url":"https://api.github.com/users/marmelab/events{/privacy}","received_events_url":"https://api.github.com/users/marmelab/received_events","type":"Organization","site_admin":false},"repo":{"id":49864754,"name":"javascript-boilerplate","full_name":"marmelab/javascript-boilerplate","owner":{"login":"marmelab","id":3116319,"avatar_url":"https://avatars.githubusercontent.com/u/3116319?v=3","gravatar_id":"","url":"https://api.github.com/users/marmelab","html_url":"https://github.com/marmelab","followers_url":"https://api.github.com/users/marmelab/followers","following_url":"https://api.github.com/users/marmelab/following{/other_user}","gists_url":"https://api.github.com/users/marmelab/gists{/gist_id}","starred_url":"https://api.github.com/users/marmelab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marmelab/subscriptions","organizations_url":"https://api.github.com/users/marmelab/orgs","repos_url":"https://api.github.com/users/marmelab/repos","events_url":"https://api.github.com/users/marmelab/events{/privacy}","received_events_url":"https://api.github.com/users/marmelab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/marmelab/javascript-boilerplate","description":"Node.js+Koa.js+PostgreSQL+React.js+Webpack+Mocha+Makefile, a starter kit for new apps","fork":false,"url":"https://api.github.com/repos/marmelab/javascript-boilerplate","forks_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/forks","keys_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/teams","hooks_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/hooks","issue_events_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/issues/events{/number}","events_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/events","assignees_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/assignees{/user}","branches_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/branches{/branch}","tags_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/tags","blobs_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/git/refs{/sha}","trees_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/statuses/{sha}","languages_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/languages","stargazers_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/stargazers","contributors_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/contributors","subscribers_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/subscribers","subscription_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/subscription","commits_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/commits{/sha}","git_commits_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/git/commits{/sha}","comments_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/comments{/number}","issue_comment_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/issues/comments{/number}","contents_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/contents/{+path}","compare_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/merges","archive_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/downloads","issues_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/issues{/number}","pulls_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/pulls{/number}","milestones_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/milestones{/number}","notifications_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/labels{/name}","releases_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/releases{/id}","deployments_url":"https://api.github.com/repos/marmelab/javascript-boilerplate/deployments","created_at":"2016-01-18T09:05:11Z","updated_at":"2016-02-26T08:15:54Z","pushed_at":"2016-02-29T09:27:51Z","git_url":"git://github.com/marmelab/javascript-boilerplate.git","ssh_url":"git@github.com:marmelab/javascript-boilerplate.git","clone_url":"https://github.com/marmelab/javascript-boilerplate.git","svn_url":"https://github.com/marmelab/javascript-boilerplate","homepage":null,"size":223,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":6,"forks":1,"open_issues":6,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/marmelab/javascript-boilerplate/pulls/36"},"html":{"href":"https://github.com/marmelab/javascript-boilerplate/pull/36"},"issue":{"href":"https://api.github.com/repos/marmelab/javascript-boilerplate/issues/36"},"comments":{"href":"https://api.github.com/repos/marmelab/javascript-boilerplate/issues/36/comments"},"review_comments":{"href":"https://api.github.com/repos/marmelab/javascript-boilerplate/pulls/36/comments"},"review_comment":{"href":"https://api.github.com/repos/marmelab/javascript-boilerplate/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/marmelab/javascript-boilerplate/pulls/36/commits"},"statuses":{"href":"https://api.github.com/repos/marmelab/javascript-boilerplate/statuses/fb16807c75b07a6750194fb67bcc6c3864a15f6f"}}}}