{"action":"created","comment":{"url":"https://api.github.com/repos/bounswe/bounswe2018group9/pulls/comments/228752207","pull_request_review_id":169096103,"id":228752207,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyODc1MjIwNw==","diff_hunk":"@@ -40,34 +39,78 @@ exports.getEventbyId = function(req, res, next)\n     }\n   });\n }\n-\n+  \n+// needs params: id(owner id as string), skip(integer, default 0), limit(integer, default 10)\n+// will return array of event objects with <limit> elements starting from object number <skip> in the db \n exports.getEventbyOwner = function(req,res,next)\n {\n-  console.log(\"Searching owner : \" + req.params.id);\n-    Event.find({'owner' : req.params.id}, function(err, docs)\n-    {\n-      if(err || !docs)\n+  var skipVar, limitVar;\n+  if(!req.query.id)\n+  {\n+    res.send(\"Please provide owner id\");\n+  }\n+ \n+  if(!req.query.skip)\n+  {\n+    skipVar=0;\n+  }\n+  else\n+  {\n+    skipVar=Number(req.query.skip);\n+  }\n+ \n+  if(!req.query.limit)\n+  {\n+    limitVar=10;\n+  }\n+  else\n+  {\n+    limitVar=Number(req.query.limit);\n+  }\n+ \n+  Event.paginate({'owner' : req.query.id}, {offset: skipVar, limit: limitVar},function(err, result){\n+      if(err || !result.docs)\n       {\n-        res.send(\"No event found with creator id: \"+ req.params.id);\n+        res.send(\"No event found with creator id: \" + req.query.id);","path":"backend/controllers/EventController.js","position":77,"original_position":77,"commit_id":"2eb6f9a95e23ee7bedc766f71112fc8b3e2d9fc2","original_commit_id":"2eb6f9a95e23ee7bedc766f71112fc8b3e2d9fc2","user":{"login":"codacy-bot","id":19940114,"node_id":"MDQ6VXNlcjE5OTQwMTE0","avatar_url":"https://avatars1.githubusercontent.com/u/19940114?v=4","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://app.codacy.com/assets/images/favicon.png) Issue found: [Strings must use singlequote. (quotes)](https://app.codacy.com/app/Actopus/bounswe2018group9/pullRequest?prid=2435487)","created_at":"2018-10-28T15:04:23Z","updated_at":"2018-10-28T15:04:24Z","html_url":"https://github.com/bounswe/bounswe2018group9/pull/203#discussion_r228752207","pull_request_url":"https://api.github.com/repos/bounswe/bounswe2018group9/pulls/203","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/bounswe/bounswe2018group9/pulls/comments/228752207"},"html":{"href":"https://github.com/bounswe/bounswe2018group9/pull/203#discussion_r228752207"},"pull_request":{"href":"https://api.github.com/repos/bounswe/bounswe2018group9/pulls/203"}}},"pull_request":{"url":"https://api.github.com/repos/bounswe/bounswe2018group9/pulls/203","id":225898955,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1ODk4OTU1","html_url":"https://github.com/bounswe/bounswe2018group9/pull/203","diff_url":"https://github.com/bounswe/bounswe2018group9/pull/203.diff","patch_url":"https://github.com/bounswe/bounswe2018group9/pull/203.patch","issue_url":"https://api.github.com/repos/bounswe/bounswe2018group9/issues/203","number":203,"state":"open","locked":false,"title":"F events pagination","user":{"login":"gumityolcu","id":36168341,"node_id":"MDQ6VXNlcjM2MTY4MzQx","avatar_url":"https://avatars1.githubusercontent.com/u/36168341?v=4","gravatar_id":"","url":"https://api.github.com/users/gumityolcu","html_url":"https://github.com/gumityolcu","followers_url":"https://api.github.com/users/gumityolcu/followers","following_url":"https://api.github.com/users/gumityolcu/following{/other_user}","gists_url":"https://api.github.com/users/gumityolcu/gists{/gist_id}","starred_url":"https://api.github.com/users/gumityolcu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gumityolcu/subscriptions","organizations_url":"https://api.github.com/users/gumityolcu/orgs","repos_url":"https://api.github.com/users/gumityolcu/repos","events_url":"https://api.github.com/users/gumityolcu/events{/privacy}","received_events_url":"https://api.github.com/users/gumityolcu/received_events","type":"User","site_admin":false},"body":"Pagination is done via 'mongoose-paginate' package.\r\n\r\nGET '/api/events' endpoint needs 2 URL parameters: skip and limit. GET '/api/events/getEventbyOwner' needs 3 parameters: id, skip and limit.\r\n\r\nIn both cases, if skip is omitted, it is assumed 0, if limit is omitted it is assumed 10. If id is omitted an error message is sent back.","created_at":"2018-10-25T20:48:24Z","updated_at":"2018-10-28T15:04:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1c9346c7d9ef930d653ebbc6f175546c3711ad94","assignee":null,"assignees":[],"requested_reviewers":[{"login":"nazmicancalik","id":25107149,"node_id":"MDQ6VXNlcjI1MTA3MTQ5","avatar_url":"https://avatars1.githubusercontent.com/u/25107149?v=4","gravatar_id":"","url":"https://api.github.com/users/nazmicancalik","html_url":"https://github.com/nazmicancalik","followers_url":"https://api.github.com/users/nazmicancalik/followers","following_url":"https://api.github.com/users/nazmicancalik/following{/other_user}","gists_url":"https://api.github.com/users/nazmicancalik/gists{/gist_id}","starred_url":"https://api.github.com/users/nazmicancalik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nazmicancalik/subscriptions","organizations_url":"https://api.github.com/users/nazmicancalik/orgs","repos_url":"https://api.github.com/users/nazmicancalik/repos","events_url":"https://api.github.com/users/nazmicancalik/events{/privacy}","received_events_url":"https://api.github.com/users/nazmicancalik/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/bounswe/bounswe2018group9/pulls/203/commits","review_comments_url":"https://api.github.com/repos/bounswe/bounswe2018group9/pulls/203/comments","review_comment_url":"https://api.github.com/repos/bounswe/bounswe2018group9/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bounswe/bounswe2018group9/issues/203/comments","statuses_url":"https://api.github.com/repos/bounswe/bounswe2018group9/statuses/2eb6f9a95e23ee7bedc766f71112fc8b3e2d9fc2","head":{"label":"bounswe:f-events-pagination","ref":"f-events-pagination","sha":"2eb6f9a95e23ee7bedc766f71112fc8b3e2d9fc2","user":{"login":"bounswe","id":12229719,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMjI5NzE5","avatar_url":"https://avatars0.githubusercontent.com/u/12229719?v=4","gravatar_id":"","url":"https://api.github.com/users/bounswe","html_url":"https://github.com/bounswe","followers_url":"https://api.github.com/users/bounswe/followers","following_url":"https://api.github.com/users/bounswe/following{/other_user}","gists_url":"https://api.github.com/users/bounswe/gists{/gist_id}","starred_url":"https://api.github.com/users/bounswe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bounswe/subscriptions","organizations_url":"https://api.github.com/users/bounswe/orgs","repos_url":"https://api.github.com/users/bounswe/repos","events_url":"https://api.github.com/users/bounswe/events{/privacy}","received_events_url":"https://api.github.com/users/bounswe/received_events","type":"Organization","site_admin":false},"repo":{"id":120274393,"node_id":"MDEwOlJlcG9zaXRvcnkxMjAyNzQzOTM=","name":"bounswe2018group9","full_name":"bounswe/bounswe2018group9","private":false,"owner":{"login":"bounswe","id":12229719,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMjI5NzE5","avatar_url":"https://avatars0.githubusercontent.com/u/12229719?v=4","gravatar_id":"","url":"https://api.github.com/users/bounswe","html_url":"https://github.com/bounswe","followers_url":"https://api.github.com/users/bounswe/followers","following_url":"https://api.github.com/users/bounswe/following{/other_user}","gists_url":"https://api.github.com/users/bounswe/gists{/gist_id}","starred_url":"https://api.github.com/users/bounswe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bounswe/subscriptions","organizations_url":"https://api.github.com/users/bounswe/orgs","repos_url":"https://api.github.com/users/bounswe/repos","events_url":"https://api.github.com/users/bounswe/events{/privacy}","received_events_url":"https://api.github.com/users/bounswe/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/bounswe/bounswe2018group9","description":"Actopus - an activity octopus","fork":false,"url":"https://api.github.com/repos/bounswe/bounswe2018group9","forks_url":"https://api.github.com/repos/bounswe/bounswe2018group9/forks","keys_url":"https://api.github.com/repos/bounswe/bounswe2018group9/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bounswe/bounswe2018group9/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bounswe/bounswe2018group9/teams","hooks_url":"https://api.github.com/repos/bounswe/bounswe2018group9/hooks","issue_events_url":"https://api.github.com/repos/bounswe/bounswe2018group9/issues/events{/number}","events_url":"https://api.github.com/repos/bounswe/bounswe2018group9/events","assignees_url":"https://api.github.com/repos/bounswe/bounswe2018group9/assignees{/user}","branches_url":"https://api.github.com/repos/bounswe/bounswe2018group9/branches{/branch}","tags_url":"https://api.github.com/repos/bounswe/bounswe2018group9/tags","blobs_url":"https://api.github.com/repos/bounswe/bounswe2018group9/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bounswe/bounswe2018group9/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bounswe/bounswe2018group9/git/refs{/sha}","trees_url":"https://api.github.com/repos/bounswe/bounswe2018group9/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bounswe/bounswe2018group9/statuses/{sha}","languages_url":"https://api.github.com/repos/bounswe/bounswe2018group9/languages","stargazers_url":"https://api.github.com/repos/bounswe/bounswe2018group9/stargazers","contributors_url":"https://api.github.com/repos/bounswe/bounswe2018group9/contributors","subscribers_url":"https://api.github.com/repos/bounswe/bounswe2018group9/subscribers","subscription_url":"https://api.github.com/repos/bounswe/bounswe2018group9/subscription","commits_url":"https://api.github.com/repos/bounswe/bounswe2018group9/commits{/sha}","git_commits_url":"https://api.github.com/repos/bounswe/bounswe2018group9/git/commits{/sha}","comments_url":"https://api.github.com/repos/bounswe/bounswe2018group9/comments{/number}","issue_comment_url":"https://api.github.com/repos/bounswe/bounswe2018group9/issues/comments{/number}","contents_url":"https://api.github.com/repos/bounswe/bounswe2018group9/contents/{+path}","compare_url":"https://api.github.com/repos/bounswe/bounswe2018group9/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bounswe/bounswe2018group9/merges","archive_url":"https://api.github.com/repos/bounswe/bounswe2018group9/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bounswe/bounswe2018group9/downloads","issues_url":"https://api.github.com/repos/bounswe/bounswe2018group9/issues{/number}","pulls_url":"https://api.github.com/repos/bounswe/bounswe2018group9/pulls{/number}","milestones_url":"https://api.github.com/repos/bounswe/bounswe2018group9/milestones{/number}","notifications_url":"https://api.github.com/repos/bounswe/bounswe2018group9/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bounswe/bounswe2018group9/labels{/name}","releases_url":"https://api.github.com/repos/bounswe/bounswe2018group9/releases{/id}","deployments_url":"https://api.github.com/repos/bounswe/bounswe2018group9/deployments","created_at":"2018-02-05T08:13:03Z","updated_at":"2018-10-28T13:50:11Z","pushed_at":"2018-10-28T15:00:28Z","git_url":"git://github.com/bounswe/bounswe2018group9.git","ssh_url":"git@github.com:bounswe/bounswe2018group9.git","clone_url":"https://github.com/bounswe/bounswe2018group9.git","svn_url":"https://github.com/bounswe/bounswe2018group9","homepage":"","size":87637,"stargazers_count":14,"watchers_count":14,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":24,"license":null,"forks":5,"open_issues":24,"watchers":14,"default_branch":"master"}},"base":{"label":"bounswe:master","ref":"master","sha":"8af956ddce17028ab9282c5a855c8119015339b1","user":{"login":"bounswe","id":12229719,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMjI5NzE5","avatar_url":"https://avatars0.githubusercontent.com/u/12229719?v=4","gravatar_id":"","url":"https://api.github.com/users/bounswe","html_url":"https://github.com/bounswe","followers_url":"https://api.github.com/users/bounswe/followers","following_url":"https://api.github.com/users/bounswe/following{/other_user}","gists_url":"https://api.github.com/users/bounswe/gists{/gist_id}","starred_url":"https://api.github.com/users/bounswe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bounswe/subscriptions","organizations_url":"https://api.github.com/users/bounswe/orgs","repos_url":"https://api.github.com/users/bounswe/repos","events_url":"https://api.github.com/users/bounswe/events{/privacy}","received_events_url":"https://api.github.com/users/bounswe/received_events","type":"Organization","site_admin":false},"repo":{"id":120274393,"node_id":"MDEwOlJlcG9zaXRvcnkxMjAyNzQzOTM=","name":"bounswe2018group9","full_name":"bounswe/bounswe2018group9","private":false,"owner":{"login":"bounswe","id":12229719,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMjI5NzE5","avatar_url":"https://avatars0.githubusercontent.com/u/12229719?v=4","gravatar_id":"","url":"https://api.github.com/users/bounswe","html_url":"https://github.com/bounswe","followers_url":"https://api.github.com/users/bounswe/followers","following_url":"https://api.github.com/users/bounswe/following{/other_user}","gists_url":"https://api.github.com/users/bounswe/gists{/gist_id}","starred_url":"https://api.github.com/users/bounswe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bounswe/subscriptions","organizations_url":"https://api.github.com/users/bounswe/orgs","repos_url":"https://api.github.com/users/bounswe/repos","events_url":"https://api.github.com/users/bounswe/events{/privacy}","received_events_url":"https://api.github.com/users/bounswe/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/bounswe/bounswe2018group9","description":"Actopus - an activity octopus","fork":false,"url":"https://api.github.com/repos/bounswe/bounswe2018group9","forks_url":"https://api.github.com/repos/bounswe/bounswe2018group9/forks","keys_url":"https://api.github.com/repos/bounswe/bounswe2018group9/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bounswe/bounswe2018group9/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bounswe/bounswe2018group9/teams","hooks_url":"https://api.github.com/repos/bounswe/bounswe2018group9/hooks","issue_events_url":"https://api.github.com/repos/bounswe/bounswe2018group9/issues/events{/number}","events_url":"https://api.github.com/repos/bounswe/bounswe2018group9/events","assignees_url":"https://api.github.com/repos/bounswe/bounswe2018group9/assignees{/user}","branches_url":"https://api.github.com/repos/bounswe/bounswe2018group9/branches{/branch}","tags_url":"https://api.github.com/repos/bounswe/bounswe2018group9/tags","blobs_url":"https://api.github.com/repos/bounswe/bounswe2018group9/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bounswe/bounswe2018group9/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bounswe/bounswe2018group9/git/refs{/sha}","trees_url":"https://api.github.com/repos/bounswe/bounswe2018group9/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bounswe/bounswe2018group9/statuses/{sha}","languages_url":"https://api.github.com/repos/bounswe/bounswe2018group9/languages","stargazers_url":"https://api.github.com/repos/bounswe/bounswe2018group9/stargazers","contributors_url":"https://api.github.com/repos/bounswe/bounswe2018group9/contributors","subscribers_url":"https://api.github.com/repos/bounswe/bounswe2018group9/subscribers","subscription_url":"https://api.github.com/repos/bounswe/bounswe2018group9/subscription","commits_url":"https://api.github.com/repos/bounswe/bounswe2018group9/commits{/sha}","git_commits_url":"https://api.github.com/repos/bounswe/bounswe2018group9/git/commits{/sha}","comments_url":"https://api.github.com/repos/bounswe/bounswe2018group9/comments{/number}","issue_comment_url":"https://api.github.com/repos/bounswe/bounswe2018group9/issues/comments{/number}","contents_url":"https://api.github.com/repos/bounswe/bounswe2018group9/contents/{+path}","compare_url":"https://api.github.com/repos/bounswe/bounswe2018group9/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bounswe/bounswe2018group9/merges","archive_url":"https://api.github.com/repos/bounswe/bounswe2018group9/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bounswe/bounswe2018group9/downloads","issues_url":"https://api.github.com/repos/bounswe/bounswe2018group9/issues{/number}","pulls_url":"https://api.github.com/repos/bounswe/bounswe2018group9/pulls{/number}","milestones_url":"https://api.github.com/repos/bounswe/bounswe2018group9/milestones{/number}","notifications_url":"https://api.github.com/repos/bounswe/bounswe2018group9/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bounswe/bounswe2018group9/labels{/name}","releases_url":"https://api.github.com/repos/bounswe/bounswe2018group9/releases{/id}","deployments_url":"https://api.github.com/repos/bounswe/bounswe2018group9/deployments","created_at":"2018-02-05T08:13:03Z","updated_at":"2018-10-28T13:50:11Z","pushed_at":"2018-10-28T15:00:28Z","git_url":"git://github.com/bounswe/bounswe2018group9.git","ssh_url":"git@github.com:bounswe/bounswe2018group9.git","clone_url":"https://github.com/bounswe/bounswe2018group9.git","svn_url":"https://github.com/bounswe/bounswe2018group9","homepage":"","size":87637,"stargazers_count":14,"watchers_count":14,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":24,"license":null,"forks":5,"open_issues":24,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bounswe/bounswe2018group9/pulls/203"},"html":{"href":"https://github.com/bounswe/bounswe2018group9/pull/203"},"issue":{"href":"https://api.github.com/repos/bounswe/bounswe2018group9/issues/203"},"comments":{"href":"https://api.github.com/repos/bounswe/bounswe2018group9/issues/203/comments"},"review_comments":{"href":"https://api.github.com/repos/bounswe/bounswe2018group9/pulls/203/comments"},"review_comment":{"href":"https://api.github.com/repos/bounswe/bounswe2018group9/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bounswe/bounswe2018group9/pulls/203/commits"},"statuses":{"href":"https://api.github.com/repos/bounswe/bounswe2018group9/statuses/2eb6f9a95e23ee7bedc766f71112fc8b3e2d9fc2"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"codacy-bot"}}