{"action":"created","comment":{"url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/pulls/comments/207423884","pull_request_review_id":143034366,"id":207423884,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNzQyMzg4NA==","diff_hunk":"@@ -13,19 +13,32 @@ exports.isString = function(value) {\n   return typeof(value) === \"string\";\n }\n \n-exports.pagination = function(resultList, page, resultsPerPage) {\n+exports.pagination = function(resultList, page, resultsPerPage, req) {\n   var result = {};\n   var totalResults = resultList.length;\n   var totalPages = 0;\n   var perPage = Number.parseInt(resultsPerPage);\n   var pageNo = Number.parseInt(page);\n-  totalPages = (totalResults % perPage) === 0 ? (totalResults / perPage) : (totalResults / perPage + 1);\n+  var prevUrl = null;\n+  var nextUrl = null;\n+  totalPages = (totalResults % perPage) === 0 ? (totalResults / perPage) : (Number.parseInt(totalResults / perPage) + 1);","path":"api/lib/routes/routeHelper.js","position":14,"original_position":14,"commit_id":"8907f86f1c91d952d5fef8f9ecb3b5315bfa4cc1","original_commit_id":"8907f86f1c91d952d5fef8f9ecb3b5315bfa4cc1","user":{"login":"qibobo","id":11609014,"node_id":"MDQ6VXNlcjExNjA5MDE0","avatar_url":"https://avatars2.githubusercontent.com/u/11609014?v=4","gravatar_id":"","url":"https://api.github.com/users/qibobo","html_url":"https://github.com/qibobo","followers_url":"https://api.github.com/users/qibobo/followers","following_url":"https://api.github.com/users/qibobo/following{/other_user}","gists_url":"https://api.github.com/users/qibobo/gists{/gist_id}","starred_url":"https://api.github.com/users/qibobo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qibobo/subscriptions","organizations_url":"https://api.github.com/users/qibobo/orgs","repos_url":"https://api.github.com/users/qibobo/repos","events_url":"https://api.github.com/users/qibobo/events{/privacy}","received_events_url":"https://api.github.com/users/qibobo/received_events","type":"User","site_admin":false},"body":"var totalResults = 5;\r\nvar resultsPerPage = 2;\r\nvar totalPages = 0;\r\nvar perPage = Number.parseInt(resultsPerPage);\r\ntotalPages = (totalResults % perPage) === 0 ? (totalResults / perPage) : (totalResults / perPage + 1);\r\n//totalPages = (totalResults % perPage) === 0 ? (totalResults / perPage) : (Number.parseInt(totalResults / perPage) + 1);\r\nconsole.log(totalPages)\r\nWithout Number.parseInt the result of the code above is 3.5 and after adding it the result is 3.","created_at":"2018-08-03T02:08:04Z","updated_at":"2018-08-03T02:08:04Z","html_url":"https://github.com/cloudfoundry-incubator/app-autoscaler/pull/371#discussion_r207423884","pull_request_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/pulls/371","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/pulls/comments/207423884"},"html":{"href":"https://github.com/cloudfoundry-incubator/app-autoscaler/pull/371#discussion_r207423884"},"pull_request":{"href":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/pulls/371"}},"in_reply_to_id":207398919},"pull_request":{"url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/pulls/371","id":205012921,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1MDEyOTIx","html_url":"https://github.com/cloudfoundry-incubator/app-autoscaler/pull/371","diff_url":"https://github.com/cloudfoundry-incubator/app-autoscaler/pull/371.diff","patch_url":"https://github.com/cloudfoundry-incubator/app-autoscaler/pull/371.patch","issue_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/issues/371","number":371,"state":"open","locked":false,"title":"adapt public rest api to cf style","user":{"login":"qibobo","id":11609014,"node_id":"MDQ6VXNlcjExNjA5MDE0","avatar_url":"https://avatars2.githubusercontent.com/u/11609014?v=4","gravatar_id":"","url":"https://api.github.com/users/qibobo","html_url":"https://github.com/qibobo","followers_url":"https://api.github.com/users/qibobo/followers","following_url":"https://api.github.com/users/qibobo/following{/other_user}","gists_url":"https://api.github.com/users/qibobo/gists{/gist_id}","starred_url":"https://api.github.com/users/qibobo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qibobo/subscriptions","organizations_url":"https://api.github.com/users/qibobo/orgs","repos_url":"https://api.github.com/users/qibobo/repos","events_url":"https://api.github.com/users/qibobo/events{/privacy}","received_events_url":"https://api.github.com/users/qibobo/received_events","type":"User","site_admin":false},"body":"[#159391488]","created_at":"2018-07-31T06:55:29Z","updated_at":"2018-08-03T02:08:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3a65569c67d6c5d53d324fd2498e8c470b0c1987","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":390161000,"node_id":"MDU6TGFiZWwzOTAxNjEwMDA=","url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/labels/unscheduled","name":"unscheduled","color":"D9D9D9","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/pulls/371/commits","review_comments_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/pulls/371/comments","review_comment_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/issues/371/comments","statuses_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/statuses/8907f86f1c91d952d5fef8f9ecb3b5315bfa4cc1","head":{"label":"qibobo:dev_qy_apicfpattern","ref":"dev_qy_apicfpattern","sha":"8907f86f1c91d952d5fef8f9ecb3b5315bfa4cc1","user":{"login":"qibobo","id":11609014,"node_id":"MDQ6VXNlcjExNjA5MDE0","avatar_url":"https://avatars2.githubusercontent.com/u/11609014?v=4","gravatar_id":"","url":"https://api.github.com/users/qibobo","html_url":"https://github.com/qibobo","followers_url":"https://api.github.com/users/qibobo/followers","following_url":"https://api.github.com/users/qibobo/following{/other_user}","gists_url":"https://api.github.com/users/qibobo/gists{/gist_id}","starred_url":"https://api.github.com/users/qibobo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qibobo/subscriptions","organizations_url":"https://api.github.com/users/qibobo/orgs","repos_url":"https://api.github.com/users/qibobo/repos","events_url":"https://api.github.com/users/qibobo/events{/privacy}","received_events_url":"https://api.github.com/users/qibobo/received_events","type":"User","site_admin":false},"repo":{"id":56480777,"node_id":"MDEwOlJlcG9zaXRvcnk1NjQ4MDc3Nw==","name":"app-autoscaler","full_name":"qibobo/app-autoscaler","owner":{"login":"qibobo","id":11609014,"node_id":"MDQ6VXNlcjExNjA5MDE0","avatar_url":"https://avatars2.githubusercontent.com/u/11609014?v=4","gravatar_id":"","url":"https://api.github.com/users/qibobo","html_url":"https://github.com/qibobo","followers_url":"https://api.github.com/users/qibobo/followers","following_url":"https://api.github.com/users/qibobo/following{/other_user}","gists_url":"https://api.github.com/users/qibobo/gists{/gist_id}","starred_url":"https://api.github.com/users/qibobo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qibobo/subscriptions","organizations_url":"https://api.github.com/users/qibobo/orgs","repos_url":"https://api.github.com/users/qibobo/repos","events_url":"https://api.github.com/users/qibobo/events{/privacy}","received_events_url":"https://api.github.com/users/qibobo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/qibobo/app-autoscaler","description":"Auto Scaling for CF Applications","fork":true,"url":"https://api.github.com/repos/qibobo/app-autoscaler","forks_url":"https://api.github.com/repos/qibobo/app-autoscaler/forks","keys_url":"https://api.github.com/repos/qibobo/app-autoscaler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qibobo/app-autoscaler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qibobo/app-autoscaler/teams","hooks_url":"https://api.github.com/repos/qibobo/app-autoscaler/hooks","issue_events_url":"https://api.github.com/repos/qibobo/app-autoscaler/issues/events{/number}","events_url":"https://api.github.com/repos/qibobo/app-autoscaler/events","assignees_url":"https://api.github.com/repos/qibobo/app-autoscaler/assignees{/user}","branches_url":"https://api.github.com/repos/qibobo/app-autoscaler/branches{/branch}","tags_url":"https://api.github.com/repos/qibobo/app-autoscaler/tags","blobs_url":"https://api.github.com/repos/qibobo/app-autoscaler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qibobo/app-autoscaler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qibobo/app-autoscaler/git/refs{/sha}","trees_url":"https://api.github.com/repos/qibobo/app-autoscaler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qibobo/app-autoscaler/statuses/{sha}","languages_url":"https://api.github.com/repos/qibobo/app-autoscaler/languages","stargazers_url":"https://api.github.com/repos/qibobo/app-autoscaler/stargazers","contributors_url":"https://api.github.com/repos/qibobo/app-autoscaler/contributors","subscribers_url":"https://api.github.com/repos/qibobo/app-autoscaler/subscribers","subscription_url":"https://api.github.com/repos/qibobo/app-autoscaler/subscription","commits_url":"https://api.github.com/repos/qibobo/app-autoscaler/commits{/sha}","git_commits_url":"https://api.github.com/repos/qibobo/app-autoscaler/git/commits{/sha}","comments_url":"https://api.github.com/repos/qibobo/app-autoscaler/comments{/number}","issue_comment_url":"https://api.github.com/repos/qibobo/app-autoscaler/issues/comments{/number}","contents_url":"https://api.github.com/repos/qibobo/app-autoscaler/contents/{+path}","compare_url":"https://api.github.com/repos/qibobo/app-autoscaler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qibobo/app-autoscaler/merges","archive_url":"https://api.github.com/repos/qibobo/app-autoscaler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qibobo/app-autoscaler/downloads","issues_url":"https://api.github.com/repos/qibobo/app-autoscaler/issues{/number}","pulls_url":"https://api.github.com/repos/qibobo/app-autoscaler/pulls{/number}","milestones_url":"https://api.github.com/repos/qibobo/app-autoscaler/milestones{/number}","notifications_url":"https://api.github.com/repos/qibobo/app-autoscaler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qibobo/app-autoscaler/labels{/name}","releases_url":"https://api.github.com/repos/qibobo/app-autoscaler/releases{/id}","deployments_url":"https://api.github.com/repos/qibobo/app-autoscaler/deployments","created_at":"2016-04-18T05:54:30Z","updated_at":"2016-04-18T05:54:31Z","pushed_at":"2018-07-31T06:05:02Z","git_url":"git://github.com/qibobo/app-autoscaler.git","ssh_url":"git@github.com:qibobo/app-autoscaler.git","clone_url":"https://github.com/qibobo/app-autoscaler.git","svn_url":"https://github.com/qibobo/app-autoscaler","homepage":"","size":16047,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"cloudfoundry-incubator:develop","ref":"develop","sha":"3c1ae3d9934552f98d85e54afb89403a46d3b3f0","user":{"login":"cloudfoundry-incubator","id":5680605,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU2ODA2MDU=","avatar_url":"https://avatars0.githubusercontent.com/u/5680605?v=4","gravatar_id":"","url":"https://api.github.com/users/cloudfoundry-incubator","html_url":"https://github.com/cloudfoundry-incubator","followers_url":"https://api.github.com/users/cloudfoundry-incubator/followers","following_url":"https://api.github.com/users/cloudfoundry-incubator/following{/other_user}","gists_url":"https://api.github.com/users/cloudfoundry-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudfoundry-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudfoundry-incubator/subscriptions","organizations_url":"https://api.github.com/users/cloudfoundry-incubator/orgs","repos_url":"https://api.github.com/users/cloudfoundry-incubator/repos","events_url":"https://api.github.com/users/cloudfoundry-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/cloudfoundry-incubator/received_events","type":"Organization","site_admin":false},"repo":{"id":55270767,"node_id":"MDEwOlJlcG9zaXRvcnk1NTI3MDc2Nw==","name":"app-autoscaler","full_name":"cloudfoundry-incubator/app-autoscaler","owner":{"login":"cloudfoundry-incubator","id":5680605,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU2ODA2MDU=","avatar_url":"https://avatars0.githubusercontent.com/u/5680605?v=4","gravatar_id":"","url":"https://api.github.com/users/cloudfoundry-incubator","html_url":"https://github.com/cloudfoundry-incubator","followers_url":"https://api.github.com/users/cloudfoundry-incubator/followers","following_url":"https://api.github.com/users/cloudfoundry-incubator/following{/other_user}","gists_url":"https://api.github.com/users/cloudfoundry-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudfoundry-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudfoundry-incubator/subscriptions","organizations_url":"https://api.github.com/users/cloudfoundry-incubator/orgs","repos_url":"https://api.github.com/users/cloudfoundry-incubator/repos","events_url":"https://api.github.com/users/cloudfoundry-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/cloudfoundry-incubator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cloudfoundry-incubator/app-autoscaler","description":"Auto Scaling for CF Applications","fork":false,"url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler","forks_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/forks","keys_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/teams","hooks_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/hooks","issue_events_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/issues/events{/number}","events_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/events","assignees_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/assignees{/user}","branches_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/branches{/branch}","tags_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/tags","blobs_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/git/refs{/sha}","trees_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/statuses/{sha}","languages_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/languages","stargazers_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/stargazers","contributors_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/contributors","subscribers_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/subscribers","subscription_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/subscription","commits_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/commits{/sha}","git_commits_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/git/commits{/sha}","comments_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/comments{/number}","issue_comment_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/issues/comments{/number}","contents_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/contents/{+path}","compare_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/merges","archive_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/downloads","issues_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/issues{/number}","pulls_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/pulls{/number}","milestones_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/milestones{/number}","notifications_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/labels{/name}","releases_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/releases{/id}","deployments_url":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/deployments","created_at":"2016-04-02T00:47:11Z","updated_at":"2018-08-02T04:55:47Z","pushed_at":"2018-08-02T04:55:45Z","git_url":"git://github.com/cloudfoundry-incubator/app-autoscaler.git","ssh_url":"git@github.com:cloudfoundry-incubator/app-autoscaler.git","clone_url":"https://github.com/cloudfoundry-incubator/app-autoscaler.git","svn_url":"https://github.com/cloudfoundry-incubator/app-autoscaler","homepage":"","size":5864,"stargazers_count":44,"watchers_count":44,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":29,"open_issues":8,"watchers":44,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/pulls/371"},"html":{"href":"https://github.com/cloudfoundry-incubator/app-autoscaler/pull/371"},"issue":{"href":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/issues/371"},"comments":{"href":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/issues/371/comments"},"review_comments":{"href":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/pulls/371/comments"},"review_comment":{"href":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/pulls/371/commits"},"statuses":{"href":"https://api.github.com/repos/cloudfoundry-incubator/app-autoscaler/statuses/8907f86f1c91d952d5fef8f9ecb3b5315bfa4cc1"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"qibobo"}}