{"action":"created","comment":{"url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/pulls/comments/236744447","pull_request_review_id":178876003,"id":236744447,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjc0NDQ0Nw==","diff_hunk":"@@ -0,0 +1,67 @@\n+/* eslint-disable camelcase */\n+import express from 'express'\n+import {\n+  getComments, getQuestions, getReactions, getThreadComments,\n+  getCommentReactions, addReaction, addQuestion, addComment\n+} from '../database'\n+import { uuid } from './helpers'\n+import { catchErrors } from '../handlers'\n+\n+const router = express.Router()\n+\n+router.get('/comments', catchErrors(async (req, res) => {\n+  await getComments().then((rows) => {\n+    res.send(rows)\n+  })\n+}))\n+\n+router.post('/comment', catchErrors(async (req, res) => {\n+  const { text, user, blob } = req.body\n+  const id = uuid()\n+  const threadId = req.body.threadId || uuid()\n+  await addComment([id, text, user, threadId, blob])\n+  res.send('OK')\n+}))\n+\n+router.get('/comments/:threadId', catchErrors(async (req, res) => {\n+  const { threadId } = req.params\n+  await getThreadComments(threadId).then((rows) => {\n+    res.send(rows)\n+  })\n+}))\n+\n+router.get('/questions', catchErrors(async (req, res) => {\n+  await getQuestions().then((rows) => {\n+    res.send(rows)\n+  })\n+}))\n+\n+router.post('/question', catchErrors(async (req, res) => {\n+  const { text, user, blob } = req.body\n+  const id = uuid()\n+  const threadId = req.body.threadId || uuid()\n+  await addQuestion([id, text, user, threadId, blob])\n+  res.send('OK')\n+}))\n+\n+router.get('/reactions', catchErrors(async (req, res) => {\n+  await getReactions().then((rows) => {\n+    res.send(rows)\n+  })\n+}))\n+\n+router.get('/reactions/:commentId', catchErrors(async (req, res) => {\n+  const { commentId } = req.params\n+  await getCommentReactions(commentId).then((rows) => {\n+    res.send(rows)\n+  })\n+}))\n+\n+router.post('/reaction', catchErrors(async (req, res) => {\n+  const { emoji, user, commentId } = req.body\n+  const id = uuid()\n+  await addReaction([id, emoji, user, commentId])\n+  res.send('OK')","path":"server/src/routes/comments.js","position":64,"original_position":64,"commit_id":"994c18f9eb55786fb6ed8635df95fdba53a0b39e","original_commit_id":"c5802cc29539b7e9df1bcb93151cc933bf1c6427","user":{"login":"bqqbarbhg","id":3875461,"node_id":"MDQ6VXNlcjM4NzU0NjE=","avatar_url":"https://avatars1.githubusercontent.com/u/3875461?v=4","gravatar_id":"","url":"https://api.github.com/users/bqqbarbhg","html_url":"https://github.com/bqqbarbhg","followers_url":"https://api.github.com/users/bqqbarbhg/followers","following_url":"https://api.github.com/users/bqqbarbhg/following{/other_user}","gists_url":"https://api.github.com/users/bqqbarbhg/gists{/gist_id}","starred_url":"https://api.github.com/users/bqqbarbhg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bqqbarbhg/subscriptions","organizations_url":"https://api.github.com/users/bqqbarbhg/orgs","repos_url":"https://api.github.com/users/bqqbarbhg/repos","events_url":"https://api.github.com/users/bqqbarbhg/events{/privacy}","received_events_url":"https://api.github.com/users/bqqbarbhg/received_events","type":"User","site_admin":false},"body":"Do we want to return the reaction data here for the client?","created_at":"2018-11-27T16:30:53Z","updated_at":"2018-11-27T16:32:19Z","html_url":"https://github.com/ktk-2005/Feedbacker-Forum/pull/19#discussion_r236744447","pull_request_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/pulls/19","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/pulls/comments/236744447"},"html":{"href":"https://github.com/ktk-2005/Feedbacker-Forum/pull/19#discussion_r236744447"},"pull_request":{"href":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/pulls/19","id":233966066,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzOTY2MDY2","html_url":"https://github.com/ktk-2005/Feedbacker-Forum/pull/19","diff_url":"https://github.com/ktk-2005/Feedbacker-Forum/pull/19.diff","patch_url":"https://github.com/ktk-2005/Feedbacker-Forum/pull/19.patch","issue_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/issues/19","number":19,"state":"open","locked":false,"title":"Node api and databases","user":{"login":"Kallemakela","id":31903287,"node_id":"MDQ6VXNlcjMxOTAzMjg3","avatar_url":"https://avatars1.githubusercontent.com/u/31903287?v=4","gravatar_id":"","url":"https://api.github.com/users/Kallemakela","html_url":"https://github.com/Kallemakela","followers_url":"https://api.github.com/users/Kallemakela/followers","following_url":"https://api.github.com/users/Kallemakela/following{/other_user}","gists_url":"https://api.github.com/users/Kallemakela/gists{/gist_id}","starred_url":"https://api.github.com/users/Kallemakela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kallemakela/subscriptions","organizations_url":"https://api.github.com/users/Kallemakela/orgs","repos_url":"https://api.github.com/users/Kallemakela/repos","events_url":"https://api.github.com/users/Kallemakela/events{/privacy}","received_events_url":"https://api.github.com/users/Kallemakela/received_events","type":"User","site_admin":false},"body":"First version of node api","created_at":"2018-11-27T15:58:44Z","updated_at":"2018-11-27T16:32:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[{"login":"HenrikHelenius","id":26705982,"node_id":"MDQ6VXNlcjI2NzA1OTgy","avatar_url":"https://avatars3.githubusercontent.com/u/26705982?v=4","gravatar_id":"","url":"https://api.github.com/users/HenrikHelenius","html_url":"https://github.com/HenrikHelenius","followers_url":"https://api.github.com/users/HenrikHelenius/followers","following_url":"https://api.github.com/users/HenrikHelenius/following{/other_user}","gists_url":"https://api.github.com/users/HenrikHelenius/gists{/gist_id}","starred_url":"https://api.github.com/users/HenrikHelenius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HenrikHelenius/subscriptions","organizations_url":"https://api.github.com/users/HenrikHelenius/orgs","repos_url":"https://api.github.com/users/HenrikHelenius/repos","events_url":"https://api.github.com/users/HenrikHelenius/events{/privacy}","received_events_url":"https://api.github.com/users/HenrikHelenius/received_events","type":"User","site_admin":false},{"login":"tobbe-j","id":32705614,"node_id":"MDQ6VXNlcjMyNzA1NjE0","avatar_url":"https://avatars3.githubusercontent.com/u/32705614?v=4","gravatar_id":"","url":"https://api.github.com/users/tobbe-j","html_url":"https://github.com/tobbe-j","followers_url":"https://api.github.com/users/tobbe-j/followers","following_url":"https://api.github.com/users/tobbe-j/following{/other_user}","gists_url":"https://api.github.com/users/tobbe-j/gists{/gist_id}","starred_url":"https://api.github.com/users/tobbe-j/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobbe-j/subscriptions","organizations_url":"https://api.github.com/users/tobbe-j/orgs","repos_url":"https://api.github.com/users/tobbe-j/repos","events_url":"https://api.github.com/users/tobbe-j/events{/privacy}","received_events_url":"https://api.github.com/users/tobbe-j/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/pulls/19/commits","review_comments_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/pulls/19/comments","review_comment_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/issues/19/comments","statuses_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/statuses/994c18f9eb55786fb6ed8635df95fdba53a0b39e","head":{"label":"ktk-2005:node-api","ref":"node-api","sha":"994c18f9eb55786fb6ed8635df95fdba53a0b39e","user":{"login":"ktk-2005","id":44653379,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0NjUzMzc5","avatar_url":"https://avatars2.githubusercontent.com/u/44653379?v=4","gravatar_id":"","url":"https://api.github.com/users/ktk-2005","html_url":"https://github.com/ktk-2005","followers_url":"https://api.github.com/users/ktk-2005/followers","following_url":"https://api.github.com/users/ktk-2005/following{/other_user}","gists_url":"https://api.github.com/users/ktk-2005/gists{/gist_id}","starred_url":"https://api.github.com/users/ktk-2005/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktk-2005/subscriptions","organizations_url":"https://api.github.com/users/ktk-2005/orgs","repos_url":"https://api.github.com/users/ktk-2005/repos","events_url":"https://api.github.com/users/ktk-2005/events{/privacy}","received_events_url":"https://api.github.com/users/ktk-2005/received_events","type":"Organization","site_admin":false},"repo":{"id":155618711,"node_id":"MDEwOlJlcG9zaXRvcnkxNTU2MTg3MTE=","name":"Feedbacker-Forum","full_name":"ktk-2005/Feedbacker-Forum","private":false,"owner":{"login":"ktk-2005","id":44653379,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0NjUzMzc5","avatar_url":"https://avatars2.githubusercontent.com/u/44653379?v=4","gravatar_id":"","url":"https://api.github.com/users/ktk-2005","html_url":"https://github.com/ktk-2005","followers_url":"https://api.github.com/users/ktk-2005/followers","following_url":"https://api.github.com/users/ktk-2005/following{/other_user}","gists_url":"https://api.github.com/users/ktk-2005/gists{/gist_id}","starred_url":"https://api.github.com/users/ktk-2005/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktk-2005/subscriptions","organizations_url":"https://api.github.com/users/ktk-2005/orgs","repos_url":"https://api.github.com/users/ktk-2005/repos","events_url":"https://api.github.com/users/ktk-2005/events{/privacy}","received_events_url":"https://api.github.com/users/ktk-2005/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ktk-2005/Feedbacker-Forum","description":null,"fork":false,"url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum","forks_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/forks","keys_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/teams","hooks_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/hooks","issue_events_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/issues/events{/number}","events_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/events","assignees_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/assignees{/user}","branches_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/branches{/branch}","tags_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/tags","blobs_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/git/refs{/sha}","trees_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/statuses/{sha}","languages_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/languages","stargazers_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/stargazers","contributors_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/contributors","subscribers_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/subscribers","subscription_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/subscription","commits_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/commits{/sha}","git_commits_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/git/commits{/sha}","comments_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/comments{/number}","issue_comment_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/issues/comments{/number}","contents_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/contents/{+path}","compare_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/merges","archive_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/downloads","issues_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/issues{/number}","pulls_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/pulls{/number}","milestones_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/milestones{/number}","notifications_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/labels{/name}","releases_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/releases{/id}","deployments_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/deployments","created_at":"2018-10-31T20:23:35Z","updated_at":"2018-11-21T18:45:27Z","pushed_at":"2018-11-27T16:23:36Z","git_url":"git://github.com/ktk-2005/Feedbacker-Forum.git","ssh_url":"git@github.com:ktk-2005/Feedbacker-Forum.git","clone_url":"https://github.com/ktk-2005/Feedbacker-Forum.git","svn_url":"https://github.com/ktk-2005/Feedbacker-Forum","homepage":null,"size":501,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":3,"watchers":0,"default_branch":"develop"}},"base":{"label":"ktk-2005:develop","ref":"develop","sha":"b4f7f9c91f274c33ff6f42bf48978641fa2ec6e5","user":{"login":"ktk-2005","id":44653379,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0NjUzMzc5","avatar_url":"https://avatars2.githubusercontent.com/u/44653379?v=4","gravatar_id":"","url":"https://api.github.com/users/ktk-2005","html_url":"https://github.com/ktk-2005","followers_url":"https://api.github.com/users/ktk-2005/followers","following_url":"https://api.github.com/users/ktk-2005/following{/other_user}","gists_url":"https://api.github.com/users/ktk-2005/gists{/gist_id}","starred_url":"https://api.github.com/users/ktk-2005/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktk-2005/subscriptions","organizations_url":"https://api.github.com/users/ktk-2005/orgs","repos_url":"https://api.github.com/users/ktk-2005/repos","events_url":"https://api.github.com/users/ktk-2005/events{/privacy}","received_events_url":"https://api.github.com/users/ktk-2005/received_events","type":"Organization","site_admin":false},"repo":{"id":155618711,"node_id":"MDEwOlJlcG9zaXRvcnkxNTU2MTg3MTE=","name":"Feedbacker-Forum","full_name":"ktk-2005/Feedbacker-Forum","private":false,"owner":{"login":"ktk-2005","id":44653379,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0NjUzMzc5","avatar_url":"https://avatars2.githubusercontent.com/u/44653379?v=4","gravatar_id":"","url":"https://api.github.com/users/ktk-2005","html_url":"https://github.com/ktk-2005","followers_url":"https://api.github.com/users/ktk-2005/followers","following_url":"https://api.github.com/users/ktk-2005/following{/other_user}","gists_url":"https://api.github.com/users/ktk-2005/gists{/gist_id}","starred_url":"https://api.github.com/users/ktk-2005/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktk-2005/subscriptions","organizations_url":"https://api.github.com/users/ktk-2005/orgs","repos_url":"https://api.github.com/users/ktk-2005/repos","events_url":"https://api.github.com/users/ktk-2005/events{/privacy}","received_events_url":"https://api.github.com/users/ktk-2005/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ktk-2005/Feedbacker-Forum","description":null,"fork":false,"url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum","forks_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/forks","keys_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/teams","hooks_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/hooks","issue_events_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/issues/events{/number}","events_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/events","assignees_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/assignees{/user}","branches_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/branches{/branch}","tags_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/tags","blobs_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/git/refs{/sha}","trees_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/statuses/{sha}","languages_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/languages","stargazers_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/stargazers","contributors_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/contributors","subscribers_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/subscribers","subscription_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/subscription","commits_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/commits{/sha}","git_commits_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/git/commits{/sha}","comments_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/comments{/number}","issue_comment_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/issues/comments{/number}","contents_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/contents/{+path}","compare_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/merges","archive_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/downloads","issues_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/issues{/number}","pulls_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/pulls{/number}","milestones_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/milestones{/number}","notifications_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/labels{/name}","releases_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/releases{/id}","deployments_url":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/deployments","created_at":"2018-10-31T20:23:35Z","updated_at":"2018-11-21T18:45:27Z","pushed_at":"2018-11-27T16:23:36Z","git_url":"git://github.com/ktk-2005/Feedbacker-Forum.git","ssh_url":"git@github.com:ktk-2005/Feedbacker-Forum.git","clone_url":"https://github.com/ktk-2005/Feedbacker-Forum.git","svn_url":"https://github.com/ktk-2005/Feedbacker-Forum","homepage":null,"size":501,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":3,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/pulls/19"},"html":{"href":"https://github.com/ktk-2005/Feedbacker-Forum/pull/19"},"issue":{"href":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/issues/19"},"comments":{"href":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/ktk-2005/Feedbacker-Forum/statuses/994c18f9eb55786fb6ed8635df95fdba53a0b39e"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"bqqbarbhg"}}