{"action":"created","comment":{"url":"https://api.github.com/repos/nelsammak/Croma/pulls/comments/29497215","id":29497215,"diff_hunk":"@@ -0,0 +1,39 @@\n+'use strict';\n+var User = require('../models/user.js'),\n+  BookClubs = require('../models/bookclub.js');\n+\n+module.exports = function(router) {\n+  router.route('/bookclubs/createbookclub').post(function createBookClub(req, res, next) {\n+    User.findById(req.body.userId, function (err, user) {\n+      if (err) {\n+        res.status(404).json(err);\n+        return next(err);\n+      }\n+      var bookClub = new BookClubs({creator: req.body.userId, name: req.body.title, users: [req.body.userId]});\n+      bookClub.save();\n+      console.log(\"hi\");\n+      var config = require('../config/config.json')[process.env.NODE_ENV];\n+      console.log(config.db.url);\n+      console.log(req.body.userId);\n+      user.bookClubs.push(bookClub._id);\n+      user.markModified('bookClubs');\n+      user.save();\n+      res.status(200).json(\"Created the Book Club Successfully\");\n+    });\n+  });\n+\n+  router.route('/bookclubs').post(function getBookClubs(req, res, next) {\n+    User.findById(req.body.userId, function (err, user) {\n+      if (err) {\n+        res.status(404).json(err);\n+        return next(err);\n+      }\n+      BookClubs.find({users: req.body.userId}, function (err, bookClubsResult) {\n+        if (err) {\n+          return next(err);\n+        }\n+        res.status(200).json(bookClubsResult);","path":"backend/views/bookclub.js","position":35,"original_position":35,"commit_id":"b405c4bf23a0c7e1801f8430515262c28649ea3f","original_commit_id":"b405c4bf23a0c7e1801f8430515262c28649ea3f","user":{"login":"Veegas","id":10804398,"avatar_url":"https://avatars.githubusercontent.com/u/10804398?v=3","gravatar_id":"","url":"https://api.github.com/users/Veegas","html_url":"https://github.com/Veegas","followers_url":"https://api.github.com/users/Veegas/followers","following_url":"https://api.github.com/users/Veegas/following{/other_user}","gists_url":"https://api.github.com/users/Veegas/gists{/gist_id}","starred_url":"https://api.github.com/users/Veegas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Veegas/subscriptions","organizations_url":"https://api.github.com/users/Veegas/orgs","repos_url":"https://api.github.com/users/Veegas/repos","events_url":"https://api.github.com/users/Veegas/events{/privacy}","received_events_url":"https://api.github.com/users/Veegas/received_events","type":"User","site_admin":false},"body":"@KarimElSheikh Post status 201","created_at":"2015-05-01T11:01:51Z","updated_at":"2015-05-01T11:01:51Z","html_url":"https://github.com/nelsammak/Croma/pull/94#discussion_r29497215","pull_request_url":"https://api.github.com/repos/nelsammak/Croma/pulls/94","_links":{"self":{"href":"https://api.github.com/repos/nelsammak/Croma/pulls/comments/29497215"},"html":{"href":"https://github.com/nelsammak/Croma/pull/94#discussion_r29497215"},"pull_request":{"href":"https://api.github.com/repos/nelsammak/Croma/pulls/94"}}},"pull_request":{"url":"https://api.github.com/repos/nelsammak/Croma/pulls/94","id":34528913,"html_url":"https://github.com/nelsammak/Croma/pull/94","diff_url":"https://github.com/nelsammak/Croma/pull/94.diff","patch_url":"https://github.com/nelsammak/Croma/pull/94.patch","issue_url":"https://api.github.com/repos/nelsammak/Croma/issues/94","number":94,"state":"open","locked":false,"title":"Create a book club 09P02 #90","user":{"login":"KarimElSheikh","id":10839251,"avatar_url":"https://avatars.githubusercontent.com/u/10839251?v=3","gravatar_id":"","url":"https://api.github.com/users/KarimElSheikh","html_url":"https://github.com/KarimElSheikh","followers_url":"https://api.github.com/users/KarimElSheikh/followers","following_url":"https://api.github.com/users/KarimElSheikh/following{/other_user}","gists_url":"https://api.github.com/users/KarimElSheikh/gists{/gist_id}","starred_url":"https://api.github.com/users/KarimElSheikh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KarimElSheikh/subscriptions","organizations_url":"https://api.github.com/users/KarimElSheikh/orgs","repos_url":"https://api.github.com/users/KarimElSheikh/repos","events_url":"https://api.github.com/users/KarimElSheikh/events{/privacy}","received_events_url":"https://api.github.com/users/KarimElSheikh/received_events","type":"User","site_admin":false},"body":"@Vegas @Mina @Israa @omarkamal95 @Mernawaseif","created_at":"2015-05-01T09:32:13Z","updated_at":"2015-05-01T11:01:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"291062dfbc4a22d503611be4c0bb546ad0a71a26","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nelsammak/Croma/pulls/94/commits","review_comments_url":"https://api.github.com/repos/nelsammak/Croma/pulls/94/comments","review_comment_url":"https://api.github.com/repos/nelsammak/Croma/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nelsammak/Croma/issues/94/comments","statuses_url":"https://api.github.com/repos/nelsammak/Croma/statuses/b405c4bf23a0c7e1801f8430515262c28649ea3f","head":{"label":"nelsammak:Create_a_book_club","ref":"Create_a_book_club","sha":"b405c4bf23a0c7e1801f8430515262c28649ea3f","user":{"login":"nelsammak","id":10855260,"avatar_url":"https://avatars.githubusercontent.com/u/10855260?v=3","gravatar_id":"","url":"https://api.github.com/users/nelsammak","html_url":"https://github.com/nelsammak","followers_url":"https://api.github.com/users/nelsammak/followers","following_url":"https://api.github.com/users/nelsammak/following{/other_user}","gists_url":"https://api.github.com/users/nelsammak/gists{/gist_id}","starred_url":"https://api.github.com/users/nelsammak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nelsammak/subscriptions","organizations_url":"https://api.github.com/users/nelsammak/orgs","repos_url":"https://api.github.com/users/nelsammak/repos","events_url":"https://api.github.com/users/nelsammak/events{/privacy}","received_events_url":"https://api.github.com/users/nelsammak/received_events","type":"User","site_admin":false},"repo":{"id":31842696,"name":"Croma","full_name":"nelsammak/Croma","owner":{"login":"nelsammak","id":10855260,"avatar_url":"https://avatars.githubusercontent.com/u/10855260?v=3","gravatar_id":"","url":"https://api.github.com/users/nelsammak","html_url":"https://github.com/nelsammak","followers_url":"https://api.github.com/users/nelsammak/followers","following_url":"https://api.github.com/users/nelsammak/following{/other_user}","gists_url":"https://api.github.com/users/nelsammak/gists{/gist_id}","starred_url":"https://api.github.com/users/nelsammak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nelsammak/subscriptions","organizations_url":"https://api.github.com/users/nelsammak/orgs","repos_url":"https://api.github.com/users/nelsammak/repos","events_url":"https://api.github.com/users/nelsammak/events{/privacy}","received_events_url":"https://api.github.com/users/nelsammak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nelsammak/Croma","description":"","fork":false,"url":"https://api.github.com/repos/nelsammak/Croma","forks_url":"https://api.github.com/repos/nelsammak/Croma/forks","keys_url":"https://api.github.com/repos/nelsammak/Croma/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nelsammak/Croma/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nelsammak/Croma/teams","hooks_url":"https://api.github.com/repos/nelsammak/Croma/hooks","issue_events_url":"https://api.github.com/repos/nelsammak/Croma/issues/events{/number}","events_url":"https://api.github.com/repos/nelsammak/Croma/events","assignees_url":"https://api.github.com/repos/nelsammak/Croma/assignees{/user}","branches_url":"https://api.github.com/repos/nelsammak/Croma/branches{/branch}","tags_url":"https://api.github.com/repos/nelsammak/Croma/tags","blobs_url":"https://api.github.com/repos/nelsammak/Croma/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nelsammak/Croma/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nelsammak/Croma/git/refs{/sha}","trees_url":"https://api.github.com/repos/nelsammak/Croma/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nelsammak/Croma/statuses/{sha}","languages_url":"https://api.github.com/repos/nelsammak/Croma/languages","stargazers_url":"https://api.github.com/repos/nelsammak/Croma/stargazers","contributors_url":"https://api.github.com/repos/nelsammak/Croma/contributors","subscribers_url":"https://api.github.com/repos/nelsammak/Croma/subscribers","subscription_url":"https://api.github.com/repos/nelsammak/Croma/subscription","commits_url":"https://api.github.com/repos/nelsammak/Croma/commits{/sha}","git_commits_url":"https://api.github.com/repos/nelsammak/Croma/git/commits{/sha}","comments_url":"https://api.github.com/repos/nelsammak/Croma/comments{/number}","issue_comment_url":"https://api.github.com/repos/nelsammak/Croma/issues/comments{/number}","contents_url":"https://api.github.com/repos/nelsammak/Croma/contents/{+path}","compare_url":"https://api.github.com/repos/nelsammak/Croma/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nelsammak/Croma/merges","archive_url":"https://api.github.com/repos/nelsammak/Croma/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nelsammak/Croma/downloads","issues_url":"https://api.github.com/repos/nelsammak/Croma/issues{/number}","pulls_url":"https://api.github.com/repos/nelsammak/Croma/pulls{/number}","milestones_url":"https://api.github.com/repos/nelsammak/Croma/milestones{/number}","notifications_url":"https://api.github.com/repos/nelsammak/Croma/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nelsammak/Croma/labels{/name}","releases_url":"https://api.github.com/repos/nelsammak/Croma/releases{/id}","created_at":"2015-03-08T08:01:10Z","updated_at":"2015-05-01T07:13:22Z","pushed_at":"2015-05-01T10:51:46Z","git_url":"git://github.com/nelsammak/Croma.git","ssh_url":"git@github.com:nelsammak/Croma.git","clone_url":"https://github.com/nelsammak/Croma.git","svn_url":"https://github.com/nelsammak/Croma","homepage":null,"size":78832,"stargazers_count":3,"watchers_count":3,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":42,"forks":0,"open_issues":42,"watchers":3,"default_branch":"master"}},"base":{"label":"nelsammak:Development","ref":"Development","sha":"269eb1ba0c4299f9eae738c733bb2443831fdd01","user":{"login":"nelsammak","id":10855260,"avatar_url":"https://avatars.githubusercontent.com/u/10855260?v=3","gravatar_id":"","url":"https://api.github.com/users/nelsammak","html_url":"https://github.com/nelsammak","followers_url":"https://api.github.com/users/nelsammak/followers","following_url":"https://api.github.com/users/nelsammak/following{/other_user}","gists_url":"https://api.github.com/users/nelsammak/gists{/gist_id}","starred_url":"https://api.github.com/users/nelsammak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nelsammak/subscriptions","organizations_url":"https://api.github.com/users/nelsammak/orgs","repos_url":"https://api.github.com/users/nelsammak/repos","events_url":"https://api.github.com/users/nelsammak/events{/privacy}","received_events_url":"https://api.github.com/users/nelsammak/received_events","type":"User","site_admin":false},"repo":{"id":31842696,"name":"Croma","full_name":"nelsammak/Croma","owner":{"login":"nelsammak","id":10855260,"avatar_url":"https://avatars.githubusercontent.com/u/10855260?v=3","gravatar_id":"","url":"https://api.github.com/users/nelsammak","html_url":"https://github.com/nelsammak","followers_url":"https://api.github.com/users/nelsammak/followers","following_url":"https://api.github.com/users/nelsammak/following{/other_user}","gists_url":"https://api.github.com/users/nelsammak/gists{/gist_id}","starred_url":"https://api.github.com/users/nelsammak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nelsammak/subscriptions","organizations_url":"https://api.github.com/users/nelsammak/orgs","repos_url":"https://api.github.com/users/nelsammak/repos","events_url":"https://api.github.com/users/nelsammak/events{/privacy}","received_events_url":"https://api.github.com/users/nelsammak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nelsammak/Croma","description":"","fork":false,"url":"https://api.github.com/repos/nelsammak/Croma","forks_url":"https://api.github.com/repos/nelsammak/Croma/forks","keys_url":"https://api.github.com/repos/nelsammak/Croma/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nelsammak/Croma/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nelsammak/Croma/teams","hooks_url":"https://api.github.com/repos/nelsammak/Croma/hooks","issue_events_url":"https://api.github.com/repos/nelsammak/Croma/issues/events{/number}","events_url":"https://api.github.com/repos/nelsammak/Croma/events","assignees_url":"https://api.github.com/repos/nelsammak/Croma/assignees{/user}","branches_url":"https://api.github.com/repos/nelsammak/Croma/branches{/branch}","tags_url":"https://api.github.com/repos/nelsammak/Croma/tags","blobs_url":"https://api.github.com/repos/nelsammak/Croma/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nelsammak/Croma/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nelsammak/Croma/git/refs{/sha}","trees_url":"https://api.github.com/repos/nelsammak/Croma/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nelsammak/Croma/statuses/{sha}","languages_url":"https://api.github.com/repos/nelsammak/Croma/languages","stargazers_url":"https://api.github.com/repos/nelsammak/Croma/stargazers","contributors_url":"https://api.github.com/repos/nelsammak/Croma/contributors","subscribers_url":"https://api.github.com/repos/nelsammak/Croma/subscribers","subscription_url":"https://api.github.com/repos/nelsammak/Croma/subscription","commits_url":"https://api.github.com/repos/nelsammak/Croma/commits{/sha}","git_commits_url":"https://api.github.com/repos/nelsammak/Croma/git/commits{/sha}","comments_url":"https://api.github.com/repos/nelsammak/Croma/comments{/number}","issue_comment_url":"https://api.github.com/repos/nelsammak/Croma/issues/comments{/number}","contents_url":"https://api.github.com/repos/nelsammak/Croma/contents/{+path}","compare_url":"https://api.github.com/repos/nelsammak/Croma/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nelsammak/Croma/merges","archive_url":"https://api.github.com/repos/nelsammak/Croma/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nelsammak/Croma/downloads","issues_url":"https://api.github.com/repos/nelsammak/Croma/issues{/number}","pulls_url":"https://api.github.com/repos/nelsammak/Croma/pulls{/number}","milestones_url":"https://api.github.com/repos/nelsammak/Croma/milestones{/number}","notifications_url":"https://api.github.com/repos/nelsammak/Croma/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nelsammak/Croma/labels{/name}","releases_url":"https://api.github.com/repos/nelsammak/Croma/releases{/id}","created_at":"2015-03-08T08:01:10Z","updated_at":"2015-05-01T07:13:22Z","pushed_at":"2015-05-01T10:51:46Z","git_url":"git://github.com/nelsammak/Croma.git","ssh_url":"git@github.com:nelsammak/Croma.git","clone_url":"https://github.com/nelsammak/Croma.git","svn_url":"https://github.com/nelsammak/Croma","homepage":null,"size":78832,"stargazers_count":3,"watchers_count":3,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":42,"forks":0,"open_issues":42,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nelsammak/Croma/pulls/94"},"html":{"href":"https://github.com/nelsammak/Croma/pull/94"},"issue":{"href":"https://api.github.com/repos/nelsammak/Croma/issues/94"},"comments":{"href":"https://api.github.com/repos/nelsammak/Croma/issues/94/comments"},"review_comments":{"href":"https://api.github.com/repos/nelsammak/Croma/pulls/94/comments"},"review_comment":{"href":"https://api.github.com/repos/nelsammak/Croma/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nelsammak/Croma/pulls/94/commits"},"statuses":{"href":"https://api.github.com/repos/nelsammak/Croma/statuses/b405c4bf23a0c7e1801f8430515262c28649ea3f"}}}}