{"action":"created","comment":{"url":"https://api.github.com/repos/usmanasif/stockking/pulls/comments/206530801","pull_request_review_id":141955328,"id":206530801,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNjUzMDgwMQ==","diff_hunk":"@@ -0,0 +1,40 @@\n+const UserStock = require('../models').UserStock;\n+const Stock = require('../models').Stock;\n+module.exports = {\n+    create(req, res) {\n+        return UserStock\n+            .create({\n+                userId: req.body.user_id,\n+                stockId: req.body.stock_id\n+            })\n+            .then(userStock => {\n+                Stock.findById(userStock.stockId)\n+                    .then(stock => res.status(200).send(stock))\n+                    .catch(err => res.status(400).send(err));\n+\n+            })\n+            .catch(err => res.status(400).send(err));\n+    },\n+    destroy(req, res) {\n+        return UserStock\n+            .findById(req.params.userStockId)\n+            .then(userStock => {\n+                if (!userStock) {\n+                    return res.status(400).send({\n+                        message: 'Relationship Not Found'\n+                    });\n+                }\n+                return userStock\n+                    .destroy()\n+                    .then(() => res.status(200).send({message: 'Deleted Successfully'}))\n+                    .catch(err => res.status(400).send(err));\n+            })\n+            .catch(err => res.status(400).send(err));\n+    },\n+    list(req, res) {\n+        return UserStock\n+            .all()\n+            .then(stock => res.status(200).send(stock))\n+            .catch(err => res.status(400).send(err));\n+    },\n+};","path":"server/controllers/userStocks.js","position":40,"original_position":40,"commit_id":"5fa701acad5fd167ce7d709153a50f7f3745a243","original_commit_id":"5fa701acad5fd167ce7d709153a50f7f3745a243","user":{"login":"usmanasif","id":473630,"node_id":"MDQ6VXNlcjQ3MzYzMA==","avatar_url":"https://avatars3.githubusercontent.com/u/473630?v=4","gravatar_id":"","url":"https://api.github.com/users/usmanasif","html_url":"https://github.com/usmanasif","followers_url":"https://api.github.com/users/usmanasif/followers","following_url":"https://api.github.com/users/usmanasif/following{/other_user}","gists_url":"https://api.github.com/users/usmanasif/gists{/gist_id}","starred_url":"https://api.github.com/users/usmanasif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/usmanasif/subscriptions","organizations_url":"https://api.github.com/users/usmanasif/orgs","repos_url":"https://api.github.com/users/usmanasif/repos","events_url":"https://api.github.com/users/usmanasif/events{/privacy}","received_events_url":"https://api.github.com/users/usmanasif/received_events","type":"User","site_admin":false},"body":"Put an extra line below it.","created_at":"2018-07-31T13:39:03Z","updated_at":"2018-07-31T13:42:47Z","html_url":"https://github.com/usmanasif/stockking/pull/1#discussion_r206530801","pull_request_url":"https://api.github.com/repos/usmanasif/stockking/pulls/1","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/usmanasif/stockking/pulls/comments/206530801"},"html":{"href":"https://github.com/usmanasif/stockking/pull/1#discussion_r206530801"},"pull_request":{"href":"https://api.github.com/repos/usmanasif/stockking/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/usmanasif/stockking/pulls/1","id":205099738,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1MDk5NzM4","html_url":"https://github.com/usmanasif/stockking/pull/1","diff_url":"https://github.com/usmanasif/stockking/pull/1.diff","patch_url":"https://github.com/usmanasif/stockking/pull/1.patch","issue_url":"https://api.github.com/repos/usmanasif/stockking/issues/1","number":1,"state":"open","locked":false,"title":"incorporated user , stock and user_stocks with node backend","user":{"login":"usmanasif","id":473630,"node_id":"MDQ6VXNlcjQ3MzYzMA==","avatar_url":"https://avatars3.githubusercontent.com/u/473630?v=4","gravatar_id":"","url":"https://api.github.com/users/usmanasif","html_url":"https://github.com/usmanasif","followers_url":"https://api.github.com/users/usmanasif/followers","following_url":"https://api.github.com/users/usmanasif/following{/other_user}","gists_url":"https://api.github.com/users/usmanasif/gists{/gist_id}","starred_url":"https://api.github.com/users/usmanasif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/usmanasif/subscriptions","organizations_url":"https://api.github.com/users/usmanasif/orgs","repos_url":"https://api.github.com/users/usmanasif/repos","events_url":"https://api.github.com/users/usmanasif/events{/privacy}","received_events_url":"https://api.github.com/users/usmanasif/received_events","type":"User","site_admin":false},"body":"Migrations\r\nYES\r\n\r\nDescription\r\nAdded react-redux with node backend for getting stocks from database, loading user stocks and addition of stocks into user stocks.","created_at":"2018-07-31T12:44:40Z","updated_at":"2018-07-31T13:42:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"19270fec7b6e096c25feb483f12f34b5b38a67aa","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/usmanasif/stockking/pulls/1/commits","review_comments_url":"https://api.github.com/repos/usmanasif/stockking/pulls/1/comments","review_comment_url":"https://api.github.com/repos/usmanasif/stockking/pulls/comments{/number}","comments_url":"https://api.github.com/repos/usmanasif/stockking/issues/1/comments","statuses_url":"https://api.github.com/repos/usmanasif/stockking/statuses/5fa701acad5fd167ce7d709153a50f7f3745a243","head":{"label":"usmanasif:add-user-stock","ref":"add-user-stock","sha":"5fa701acad5fd167ce7d709153a50f7f3745a243","user":{"login":"usmanasif","id":473630,"node_id":"MDQ6VXNlcjQ3MzYzMA==","avatar_url":"https://avatars3.githubusercontent.com/u/473630?v=4","gravatar_id":"","url":"https://api.github.com/users/usmanasif","html_url":"https://github.com/usmanasif","followers_url":"https://api.github.com/users/usmanasif/followers","following_url":"https://api.github.com/users/usmanasif/following{/other_user}","gists_url":"https://api.github.com/users/usmanasif/gists{/gist_id}","starred_url":"https://api.github.com/users/usmanasif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/usmanasif/subscriptions","organizations_url":"https://api.github.com/users/usmanasif/orgs","repos_url":"https://api.github.com/users/usmanasif/repos","events_url":"https://api.github.com/users/usmanasif/events{/privacy}","received_events_url":"https://api.github.com/users/usmanasif/received_events","type":"User","site_admin":false},"repo":{"id":142578504,"node_id":"MDEwOlJlcG9zaXRvcnkxNDI1Nzg1MDQ=","name":"stockking","full_name":"usmanasif/stockking","owner":{"login":"usmanasif","id":473630,"node_id":"MDQ6VXNlcjQ3MzYzMA==","avatar_url":"https://avatars3.githubusercontent.com/u/473630?v=4","gravatar_id":"","url":"https://api.github.com/users/usmanasif","html_url":"https://github.com/usmanasif","followers_url":"https://api.github.com/users/usmanasif/followers","following_url":"https://api.github.com/users/usmanasif/following{/other_user}","gists_url":"https://api.github.com/users/usmanasif/gists{/gist_id}","starred_url":"https://api.github.com/users/usmanasif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/usmanasif/subscriptions","organizations_url":"https://api.github.com/users/usmanasif/orgs","repos_url":"https://api.github.com/users/usmanasif/repos","events_url":"https://api.github.com/users/usmanasif/events{/privacy}","received_events_url":"https://api.github.com/users/usmanasif/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/usmanasif/stockking","description":null,"fork":false,"url":"https://api.github.com/repos/usmanasif/stockking","forks_url":"https://api.github.com/repos/usmanasif/stockking/forks","keys_url":"https://api.github.com/repos/usmanasif/stockking/keys{/key_id}","collaborators_url":"https://api.github.com/repos/usmanasif/stockking/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/usmanasif/stockking/teams","hooks_url":"https://api.github.com/repos/usmanasif/stockking/hooks","issue_events_url":"https://api.github.com/repos/usmanasif/stockking/issues/events{/number}","events_url":"https://api.github.com/repos/usmanasif/stockking/events","assignees_url":"https://api.github.com/repos/usmanasif/stockking/assignees{/user}","branches_url":"https://api.github.com/repos/usmanasif/stockking/branches{/branch}","tags_url":"https://api.github.com/repos/usmanasif/stockking/tags","blobs_url":"https://api.github.com/repos/usmanasif/stockking/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/usmanasif/stockking/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/usmanasif/stockking/git/refs{/sha}","trees_url":"https://api.github.com/repos/usmanasif/stockking/git/trees{/sha}","statuses_url":"https://api.github.com/repos/usmanasif/stockking/statuses/{sha}","languages_url":"https://api.github.com/repos/usmanasif/stockking/languages","stargazers_url":"https://api.github.com/repos/usmanasif/stockking/stargazers","contributors_url":"https://api.github.com/repos/usmanasif/stockking/contributors","subscribers_url":"https://api.github.com/repos/usmanasif/stockking/subscribers","subscription_url":"https://api.github.com/repos/usmanasif/stockking/subscription","commits_url":"https://api.github.com/repos/usmanasif/stockking/commits{/sha}","git_commits_url":"https://api.github.com/repos/usmanasif/stockking/git/commits{/sha}","comments_url":"https://api.github.com/repos/usmanasif/stockking/comments{/number}","issue_comment_url":"https://api.github.com/repos/usmanasif/stockking/issues/comments{/number}","contents_url":"https://api.github.com/repos/usmanasif/stockking/contents/{+path}","compare_url":"https://api.github.com/repos/usmanasif/stockking/compare/{base}...{head}","merges_url":"https://api.github.com/repos/usmanasif/stockking/merges","archive_url":"https://api.github.com/repos/usmanasif/stockking/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/usmanasif/stockking/downloads","issues_url":"https://api.github.com/repos/usmanasif/stockking/issues{/number}","pulls_url":"https://api.github.com/repos/usmanasif/stockking/pulls{/number}","milestones_url":"https://api.github.com/repos/usmanasif/stockking/milestones{/number}","notifications_url":"https://api.github.com/repos/usmanasif/stockking/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/usmanasif/stockking/labels{/name}","releases_url":"https://api.github.com/repos/usmanasif/stockking/releases{/id}","deployments_url":"https://api.github.com/repos/usmanasif/stockking/deployments","created_at":"2018-07-27T13:07:51Z","updated_at":"2018-07-30T18:38:48Z","pushed_at":"2018-07-31T12:44:41Z","git_url":"git://github.com/usmanasif/stockking.git","ssh_url":"git@github.com:usmanasif/stockking.git","clone_url":"https://github.com/usmanasif/stockking.git","svn_url":"https://github.com/usmanasif/stockking","homepage":null,"size":4186,"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":"usmanasif:master","ref":"master","sha":"105b62744cf217466677725ccd25d775770129b0","user":{"login":"usmanasif","id":473630,"node_id":"MDQ6VXNlcjQ3MzYzMA==","avatar_url":"https://avatars3.githubusercontent.com/u/473630?v=4","gravatar_id":"","url":"https://api.github.com/users/usmanasif","html_url":"https://github.com/usmanasif","followers_url":"https://api.github.com/users/usmanasif/followers","following_url":"https://api.github.com/users/usmanasif/following{/other_user}","gists_url":"https://api.github.com/users/usmanasif/gists{/gist_id}","starred_url":"https://api.github.com/users/usmanasif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/usmanasif/subscriptions","organizations_url":"https://api.github.com/users/usmanasif/orgs","repos_url":"https://api.github.com/users/usmanasif/repos","events_url":"https://api.github.com/users/usmanasif/events{/privacy}","received_events_url":"https://api.github.com/users/usmanasif/received_events","type":"User","site_admin":false},"repo":{"id":142578504,"node_id":"MDEwOlJlcG9zaXRvcnkxNDI1Nzg1MDQ=","name":"stockking","full_name":"usmanasif/stockking","owner":{"login":"usmanasif","id":473630,"node_id":"MDQ6VXNlcjQ3MzYzMA==","avatar_url":"https://avatars3.githubusercontent.com/u/473630?v=4","gravatar_id":"","url":"https://api.github.com/users/usmanasif","html_url":"https://github.com/usmanasif","followers_url":"https://api.github.com/users/usmanasif/followers","following_url":"https://api.github.com/users/usmanasif/following{/other_user}","gists_url":"https://api.github.com/users/usmanasif/gists{/gist_id}","starred_url":"https://api.github.com/users/usmanasif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/usmanasif/subscriptions","organizations_url":"https://api.github.com/users/usmanasif/orgs","repos_url":"https://api.github.com/users/usmanasif/repos","events_url":"https://api.github.com/users/usmanasif/events{/privacy}","received_events_url":"https://api.github.com/users/usmanasif/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/usmanasif/stockking","description":null,"fork":false,"url":"https://api.github.com/repos/usmanasif/stockking","forks_url":"https://api.github.com/repos/usmanasif/stockking/forks","keys_url":"https://api.github.com/repos/usmanasif/stockking/keys{/key_id}","collaborators_url":"https://api.github.com/repos/usmanasif/stockking/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/usmanasif/stockking/teams","hooks_url":"https://api.github.com/repos/usmanasif/stockking/hooks","issue_events_url":"https://api.github.com/repos/usmanasif/stockking/issues/events{/number}","events_url":"https://api.github.com/repos/usmanasif/stockking/events","assignees_url":"https://api.github.com/repos/usmanasif/stockking/assignees{/user}","branches_url":"https://api.github.com/repos/usmanasif/stockking/branches{/branch}","tags_url":"https://api.github.com/repos/usmanasif/stockking/tags","blobs_url":"https://api.github.com/repos/usmanasif/stockking/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/usmanasif/stockking/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/usmanasif/stockking/git/refs{/sha}","trees_url":"https://api.github.com/repos/usmanasif/stockking/git/trees{/sha}","statuses_url":"https://api.github.com/repos/usmanasif/stockking/statuses/{sha}","languages_url":"https://api.github.com/repos/usmanasif/stockking/languages","stargazers_url":"https://api.github.com/repos/usmanasif/stockking/stargazers","contributors_url":"https://api.github.com/repos/usmanasif/stockking/contributors","subscribers_url":"https://api.github.com/repos/usmanasif/stockking/subscribers","subscription_url":"https://api.github.com/repos/usmanasif/stockking/subscription","commits_url":"https://api.github.com/repos/usmanasif/stockking/commits{/sha}","git_commits_url":"https://api.github.com/repos/usmanasif/stockking/git/commits{/sha}","comments_url":"https://api.github.com/repos/usmanasif/stockking/comments{/number}","issue_comment_url":"https://api.github.com/repos/usmanasif/stockking/issues/comments{/number}","contents_url":"https://api.github.com/repos/usmanasif/stockking/contents/{+path}","compare_url":"https://api.github.com/repos/usmanasif/stockking/compare/{base}...{head}","merges_url":"https://api.github.com/repos/usmanasif/stockking/merges","archive_url":"https://api.github.com/repos/usmanasif/stockking/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/usmanasif/stockking/downloads","issues_url":"https://api.github.com/repos/usmanasif/stockking/issues{/number}","pulls_url":"https://api.github.com/repos/usmanasif/stockking/pulls{/number}","milestones_url":"https://api.github.com/repos/usmanasif/stockking/milestones{/number}","notifications_url":"https://api.github.com/repos/usmanasif/stockking/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/usmanasif/stockking/labels{/name}","releases_url":"https://api.github.com/repos/usmanasif/stockking/releases{/id}","deployments_url":"https://api.github.com/repos/usmanasif/stockking/deployments","created_at":"2018-07-27T13:07:51Z","updated_at":"2018-07-30T18:38:48Z","pushed_at":"2018-07-31T12:44:41Z","git_url":"git://github.com/usmanasif/stockking.git","ssh_url":"git@github.com:usmanasif/stockking.git","clone_url":"https://github.com/usmanasif/stockking.git","svn_url":"https://github.com/usmanasif/stockking","homepage":null,"size":4186,"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/usmanasif/stockking/pulls/1"},"html":{"href":"https://github.com/usmanasif/stockking/pull/1"},"issue":{"href":"https://api.github.com/repos/usmanasif/stockking/issues/1"},"comments":{"href":"https://api.github.com/repos/usmanasif/stockking/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/usmanasif/stockking/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/usmanasif/stockking/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/usmanasif/stockking/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/usmanasif/stockking/statuses/5fa701acad5fd167ce7d709153a50f7f3745a243"}},"author_association":"OWNER"}}
{"actor":{"display_login":"usmanasif"}}