{"action":"created","comment":{"url":"https://api.github.com/repos/kalenkevich/test2/pulls/comments/178261946","pull_request_review_id":108296278,"id":178261946,"diff_hunk":"@@ -53,32 +54,55 @@ const initSelectComponent = () => {\n const initCardNumberComponent = () => {\n     $('#card-number').myCardNumber({\n         numberCards: [{\n-            value: 1,\n+            value: 0,\n             label: '1'\n         }, {\n-            value: 2,\n+            value: 1,\n             label: '2'\n         }, {\n-            value: 3,\n+            value: 2,\n             label: '3'\n         }, {\n-            value: 4,\n+            value: 3,\n             label: '4'\n         }, {\n-            value: 5,\n+            value: 4,\n             label: '5'\n+        }, {\n+            value: 5,\n+            label: '6'\n         }],\n         onNumberCardClicked: (cardValue) => {\n-            console.log(cardValue);\n+            paginationComponent(cardValue);\n         }\n     });\n };\n \n+const paginationComponent = (cardValue) => {\n+    const itemNumber = Number(cardValue);\n+    const allProducts = productsItems.length;\n+\n+    for(let item = 0; item < allProducts; item++){\n+        const productId = Number(productsItems[item].id);\n+        if(productId===itemNumber){\n+\n+            const paginationComponent = new PaginationComponent(productsItems[item]);\n+            const $pagination = $('#product-list');\n+\n+            $pagination.empty();\n+            $pagination.append(paginationComponent.render());\n+        } else {\n+\n+        }\n+    }\n+};\n+\n document.addEventListener(\"DOMContentLoaded\", async () => {\n     initSearchComponent();\n     initSelectComponent();\n     initCardNumberComponent();\n \n     productsItems = await ProductService.getAllProducts();\n     renderProducts(productsItems);\n+    console.log(productsItems)","path":"src/main.js","position":68,"original_position":68,"commit_id":"7b112858883e13687e353c4b5c67ad0fc7bb1ed3","original_commit_id":"7b112858883e13687e353c4b5c67ad0fc7bb1ed3","user":{"login":"kalenkevich","id":9913893,"avatar_url":"https://avatars3.githubusercontent.com/u/9913893?v=4","gravatar_id":"","url":"https://api.github.com/users/kalenkevich","html_url":"https://github.com/kalenkevich","followers_url":"https://api.github.com/users/kalenkevich/followers","following_url":"https://api.github.com/users/kalenkevich/following{/other_user}","gists_url":"https://api.github.com/users/kalenkevich/gists{/gist_id}","starred_url":"https://api.github.com/users/kalenkevich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kalenkevich/subscriptions","organizations_url":"https://api.github.com/users/kalenkevich/orgs","repos_url":"https://api.github.com/users/kalenkevich/repos","events_url":"https://api.github.com/users/kalenkevich/events{/privacy}","received_events_url":"https://api.github.com/users/kalenkevich/received_events","type":"User","site_admin":false},"body":"привет php?  удали это и забудь, используй debug","created_at":"2018-03-30T09:24:53Z","updated_at":"2018-03-30T09:29:32Z","html_url":"https://github.com/kalenkevich/test2/pull/1#discussion_r178261946","pull_request_url":"https://api.github.com/repos/kalenkevich/test2/pulls/1","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/kalenkevich/test2/pulls/comments/178261946"},"html":{"href":"https://github.com/kalenkevich/test2/pull/1#discussion_r178261946"},"pull_request":{"href":"https://api.github.com/repos/kalenkevich/test2/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/kalenkevich/test2/pulls/1","id":178524068,"html_url":"https://github.com/kalenkevich/test2/pull/1","diff_url":"https://github.com/kalenkevich/test2/pull/1.diff","patch_url":"https://github.com/kalenkevich/test2/pull/1.patch","issue_url":"https://api.github.com/repos/kalenkevich/test2/issues/1","number":1,"state":"open","locked":false,"title":"add pagination-component","user":{"login":"marinazhyravlyova","id":22644074,"avatar_url":"https://avatars3.githubusercontent.com/u/22644074?v=4","gravatar_id":"","url":"https://api.github.com/users/marinazhyravlyova","html_url":"https://github.com/marinazhyravlyova","followers_url":"https://api.github.com/users/marinazhyravlyova/followers","following_url":"https://api.github.com/users/marinazhyravlyova/following{/other_user}","gists_url":"https://api.github.com/users/marinazhyravlyova/gists{/gist_id}","starred_url":"https://api.github.com/users/marinazhyravlyova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marinazhyravlyova/subscriptions","organizations_url":"https://api.github.com/users/marinazhyravlyova/orgs","repos_url":"https://api.github.com/users/marinazhyravlyova/repos","events_url":"https://api.github.com/users/marinazhyravlyova/events{/privacy}","received_events_url":"https://api.github.com/users/marinazhyravlyova/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-03-30T09:12:10Z","updated_at":"2018-03-30T09:29:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"672b28714c8950d54f489850e36972ea0db5fcd1","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/kalenkevich/test2/pulls/1/commits","review_comments_url":"https://api.github.com/repos/kalenkevich/test2/pulls/1/comments","review_comment_url":"https://api.github.com/repos/kalenkevich/test2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kalenkevich/test2/issues/1/comments","statuses_url":"https://api.github.com/repos/kalenkevich/test2/statuses/7b112858883e13687e353c4b5c67ad0fc7bb1ed3","head":{"label":"kalenkevich:pagination-component","ref":"pagination-component","sha":"7b112858883e13687e353c4b5c67ad0fc7bb1ed3","user":{"login":"kalenkevich","id":9913893,"avatar_url":"https://avatars3.githubusercontent.com/u/9913893?v=4","gravatar_id":"","url":"https://api.github.com/users/kalenkevich","html_url":"https://github.com/kalenkevich","followers_url":"https://api.github.com/users/kalenkevich/followers","following_url":"https://api.github.com/users/kalenkevich/following{/other_user}","gists_url":"https://api.github.com/users/kalenkevich/gists{/gist_id}","starred_url":"https://api.github.com/users/kalenkevich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kalenkevich/subscriptions","organizations_url":"https://api.github.com/users/kalenkevich/orgs","repos_url":"https://api.github.com/users/kalenkevich/repos","events_url":"https://api.github.com/users/kalenkevich/events{/privacy}","received_events_url":"https://api.github.com/users/kalenkevich/received_events","type":"User","site_admin":false},"repo":{"id":126743920,"name":"test2","full_name":"kalenkevich/test2","owner":{"login":"kalenkevich","id":9913893,"avatar_url":"https://avatars3.githubusercontent.com/u/9913893?v=4","gravatar_id":"","url":"https://api.github.com/users/kalenkevich","html_url":"https://github.com/kalenkevich","followers_url":"https://api.github.com/users/kalenkevich/followers","following_url":"https://api.github.com/users/kalenkevich/following{/other_user}","gists_url":"https://api.github.com/users/kalenkevich/gists{/gist_id}","starred_url":"https://api.github.com/users/kalenkevich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kalenkevich/subscriptions","organizations_url":"https://api.github.com/users/kalenkevich/orgs","repos_url":"https://api.github.com/users/kalenkevich/repos","events_url":"https://api.github.com/users/kalenkevich/events{/privacy}","received_events_url":"https://api.github.com/users/kalenkevich/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kalenkevich/test2","description":null,"fork":false,"url":"https://api.github.com/repos/kalenkevich/test2","forks_url":"https://api.github.com/repos/kalenkevich/test2/forks","keys_url":"https://api.github.com/repos/kalenkevich/test2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kalenkevich/test2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kalenkevich/test2/teams","hooks_url":"https://api.github.com/repos/kalenkevich/test2/hooks","issue_events_url":"https://api.github.com/repos/kalenkevich/test2/issues/events{/number}","events_url":"https://api.github.com/repos/kalenkevich/test2/events","assignees_url":"https://api.github.com/repos/kalenkevich/test2/assignees{/user}","branches_url":"https://api.github.com/repos/kalenkevich/test2/branches{/branch}","tags_url":"https://api.github.com/repos/kalenkevich/test2/tags","blobs_url":"https://api.github.com/repos/kalenkevich/test2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kalenkevich/test2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kalenkevich/test2/git/refs{/sha}","trees_url":"https://api.github.com/repos/kalenkevich/test2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kalenkevich/test2/statuses/{sha}","languages_url":"https://api.github.com/repos/kalenkevich/test2/languages","stargazers_url":"https://api.github.com/repos/kalenkevich/test2/stargazers","contributors_url":"https://api.github.com/repos/kalenkevich/test2/contributors","subscribers_url":"https://api.github.com/repos/kalenkevich/test2/subscribers","subscription_url":"https://api.github.com/repos/kalenkevich/test2/subscription","commits_url":"https://api.github.com/repos/kalenkevich/test2/commits{/sha}","git_commits_url":"https://api.github.com/repos/kalenkevich/test2/git/commits{/sha}","comments_url":"https://api.github.com/repos/kalenkevich/test2/comments{/number}","issue_comment_url":"https://api.github.com/repos/kalenkevich/test2/issues/comments{/number}","contents_url":"https://api.github.com/repos/kalenkevich/test2/contents/{+path}","compare_url":"https://api.github.com/repos/kalenkevich/test2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kalenkevich/test2/merges","archive_url":"https://api.github.com/repos/kalenkevich/test2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kalenkevich/test2/downloads","issues_url":"https://api.github.com/repos/kalenkevich/test2/issues{/number}","pulls_url":"https://api.github.com/repos/kalenkevich/test2/pulls{/number}","milestones_url":"https://api.github.com/repos/kalenkevich/test2/milestones{/number}","notifications_url":"https://api.github.com/repos/kalenkevich/test2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kalenkevich/test2/labels{/name}","releases_url":"https://api.github.com/repos/kalenkevich/test2/releases{/id}","deployments_url":"https://api.github.com/repos/kalenkevich/test2/deployments","created_at":"2018-03-25T21:59:41Z","updated_at":"2018-03-30T09:09:45Z","pushed_at":"2018-03-30T09:12:11Z","git_url":"git://github.com/kalenkevich/test2.git","ssh_url":"git@github.com:kalenkevich/test2.git","clone_url":"https://github.com/kalenkevich/test2.git","svn_url":"https://github.com/kalenkevich/test2","homepage":null,"size":451,"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":"kalenkevich:master","ref":"master","sha":"0e4e9894f4d9ad6ddac668ae7a4d00f1799c26f0","user":{"login":"kalenkevich","id":9913893,"avatar_url":"https://avatars3.githubusercontent.com/u/9913893?v=4","gravatar_id":"","url":"https://api.github.com/users/kalenkevich","html_url":"https://github.com/kalenkevich","followers_url":"https://api.github.com/users/kalenkevich/followers","following_url":"https://api.github.com/users/kalenkevich/following{/other_user}","gists_url":"https://api.github.com/users/kalenkevich/gists{/gist_id}","starred_url":"https://api.github.com/users/kalenkevich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kalenkevich/subscriptions","organizations_url":"https://api.github.com/users/kalenkevich/orgs","repos_url":"https://api.github.com/users/kalenkevich/repos","events_url":"https://api.github.com/users/kalenkevich/events{/privacy}","received_events_url":"https://api.github.com/users/kalenkevich/received_events","type":"User","site_admin":false},"repo":{"id":126743920,"name":"test2","full_name":"kalenkevich/test2","owner":{"login":"kalenkevich","id":9913893,"avatar_url":"https://avatars3.githubusercontent.com/u/9913893?v=4","gravatar_id":"","url":"https://api.github.com/users/kalenkevich","html_url":"https://github.com/kalenkevich","followers_url":"https://api.github.com/users/kalenkevich/followers","following_url":"https://api.github.com/users/kalenkevich/following{/other_user}","gists_url":"https://api.github.com/users/kalenkevich/gists{/gist_id}","starred_url":"https://api.github.com/users/kalenkevich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kalenkevich/subscriptions","organizations_url":"https://api.github.com/users/kalenkevich/orgs","repos_url":"https://api.github.com/users/kalenkevich/repos","events_url":"https://api.github.com/users/kalenkevich/events{/privacy}","received_events_url":"https://api.github.com/users/kalenkevich/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kalenkevich/test2","description":null,"fork":false,"url":"https://api.github.com/repos/kalenkevich/test2","forks_url":"https://api.github.com/repos/kalenkevich/test2/forks","keys_url":"https://api.github.com/repos/kalenkevich/test2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kalenkevich/test2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kalenkevich/test2/teams","hooks_url":"https://api.github.com/repos/kalenkevich/test2/hooks","issue_events_url":"https://api.github.com/repos/kalenkevich/test2/issues/events{/number}","events_url":"https://api.github.com/repos/kalenkevich/test2/events","assignees_url":"https://api.github.com/repos/kalenkevich/test2/assignees{/user}","branches_url":"https://api.github.com/repos/kalenkevich/test2/branches{/branch}","tags_url":"https://api.github.com/repos/kalenkevich/test2/tags","blobs_url":"https://api.github.com/repos/kalenkevich/test2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kalenkevich/test2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kalenkevich/test2/git/refs{/sha}","trees_url":"https://api.github.com/repos/kalenkevich/test2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kalenkevich/test2/statuses/{sha}","languages_url":"https://api.github.com/repos/kalenkevich/test2/languages","stargazers_url":"https://api.github.com/repos/kalenkevich/test2/stargazers","contributors_url":"https://api.github.com/repos/kalenkevich/test2/contributors","subscribers_url":"https://api.github.com/repos/kalenkevich/test2/subscribers","subscription_url":"https://api.github.com/repos/kalenkevich/test2/subscription","commits_url":"https://api.github.com/repos/kalenkevich/test2/commits{/sha}","git_commits_url":"https://api.github.com/repos/kalenkevich/test2/git/commits{/sha}","comments_url":"https://api.github.com/repos/kalenkevich/test2/comments{/number}","issue_comment_url":"https://api.github.com/repos/kalenkevich/test2/issues/comments{/number}","contents_url":"https://api.github.com/repos/kalenkevich/test2/contents/{+path}","compare_url":"https://api.github.com/repos/kalenkevich/test2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kalenkevich/test2/merges","archive_url":"https://api.github.com/repos/kalenkevich/test2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kalenkevich/test2/downloads","issues_url":"https://api.github.com/repos/kalenkevich/test2/issues{/number}","pulls_url":"https://api.github.com/repos/kalenkevich/test2/pulls{/number}","milestones_url":"https://api.github.com/repos/kalenkevich/test2/milestones{/number}","notifications_url":"https://api.github.com/repos/kalenkevich/test2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kalenkevich/test2/labels{/name}","releases_url":"https://api.github.com/repos/kalenkevich/test2/releases{/id}","deployments_url":"https://api.github.com/repos/kalenkevich/test2/deployments","created_at":"2018-03-25T21:59:41Z","updated_at":"2018-03-30T09:09:45Z","pushed_at":"2018-03-30T09:12:11Z","git_url":"git://github.com/kalenkevich/test2.git","ssh_url":"git@github.com:kalenkevich/test2.git","clone_url":"https://github.com/kalenkevich/test2.git","svn_url":"https://github.com/kalenkevich/test2","homepage":null,"size":451,"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/kalenkevich/test2/pulls/1"},"html":{"href":"https://github.com/kalenkevich/test2/pull/1"},"issue":{"href":"https://api.github.com/repos/kalenkevich/test2/issues/1"},"comments":{"href":"https://api.github.com/repos/kalenkevich/test2/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/kalenkevich/test2/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/kalenkevich/test2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kalenkevich/test2/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/kalenkevich/test2/statuses/7b112858883e13687e353c4b5c67ad0fc7bb1ed3"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"kalenkevich"}}