{"action":"created","comment":{"url":"https://api.github.com/repos/Efosaok/More-Recipes/pulls/comments/148612378","pull_request_review_id":73883628,"id":148612378,"diff_hunk":"@@ -0,0 +1,96 @@\n+const alphaNumeric = (inputtxt) => {\n+  const letterNumber = /((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+[0-9a-z]+$/i;\n+  if (inputtxt.match(letterNumber)) {\n+    return true;\n+  } else {\n+    return false;\n+  }\n+};\n+\n+const checkNullInput = (req, res, next) => {\n+  if (req.method !== 'POST') {\n+    return res.status(300).send({ message: 'Invalid request method' });\n+  } else {\n+    let isUndefined = false;\n+    let isNull = false;\n+    let isWhiteSpace = false;\n+    let isString = true;\n+    const {\n+      name,\n+      category,\n+      description,\n+      creator,\n+      ingredients,\n+    } = req.body;\n+    [name, category, description, creator, ingredients].forEach((info) => {\n+      if (info === undefined) {\n+        isUndefined = true;\n+      }\n+      if (info === '') {\n+        isNull = true;\n+      }\n+      if (!isUndefined && !alphaNumeric(info)) {\n+        if (Number.isInteger(parseFloat(info))) {\n+          isString = false;\n+        }\n+      }\n+      if (!isUndefined && typeof info !== 'number') {\n+        if (info.replace(/\\s/g, '').length === 0) {\n+          isWhiteSpace = true;\n+        }\n+      }\n+    });\n+    if (isUndefined) {\n+      return res.status(400).send({ error: 'Please fill in all fields' });\n+    }\n+    if (isNull) {\n+      return res.status(400).send({ error: 'A field does not contain any input' });\n+    }\n+    if (!isString) {\n+      return res.status(400).send({ error: 'Only texts can be inputed' });\n+    }\n+    if (isWhiteSpace) {\n+      return res.status(400).send({ error: 'Your input should not contain only white-spaces' });\n+    } else {\n+      next();\n+    }\n+  }\n+};\n+\n+const checkInvalidReview = (req, res, next) => {\n+  if (req.method !== 'POST') {\n+    return res.status(400).send({ error: 'Invalid request method' });\n+  } else {\n+    let isUndefined = false;","path":"Server/middlewares/errors.js","position":64,"original_position":64,"commit_id":"8c64f1624d4356dfe392169ef3816b695d1eed16","original_commit_id":"8c64f1624d4356dfe392169ef3816b695d1eed16","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).","created_at":"2017-11-02T17:54:38Z","updated_at":"2017-11-02T17:54:39Z","html_url":"https://github.com/Efosaok/More-Recipes/pull/10#discussion_r148612378","pull_request_url":"https://api.github.com/repos/Efosaok/More-Recipes/pulls/10","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Efosaok/More-Recipes/pulls/comments/148612378"},"html":{"href":"https://github.com/Efosaok/More-Recipes/pull/10#discussion_r148612378"},"pull_request":{"href":"https://api.github.com/repos/Efosaok/More-Recipes/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/Efosaok/More-Recipes/pulls/10","id":149455978,"html_url":"https://github.com/Efosaok/More-Recipes/pull/10","diff_url":"https://github.com/Efosaok/More-Recipes/pull/10.diff","patch_url":"https://github.com/Efosaok/More-Recipes/pull/10.patch","issue_url":"https://api.github.com/repos/Efosaok/More-Recipes/issues/10","number":10,"state":"open","locked":false,"title":"Development","user":{"login":"Efosaok","id":24938186,"avatar_url":"https://avatars2.githubusercontent.com/u/24938186?v=4","gravatar_id":"","url":"https://api.github.com/users/Efosaok","html_url":"https://github.com/Efosaok","followers_url":"https://api.github.com/users/Efosaok/followers","following_url":"https://api.github.com/users/Efosaok/following{/other_user}","gists_url":"https://api.github.com/users/Efosaok/gists{/gist_id}","starred_url":"https://api.github.com/users/Efosaok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Efosaok/subscriptions","organizations_url":"https://api.github.com/users/Efosaok/orgs","repos_url":"https://api.github.com/users/Efosaok/repos","events_url":"https://api.github.com/users/Efosaok/events{/privacy}","received_events_url":"https://api.github.com/users/Efosaok/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-10-30T07:54:57Z","updated_at":"2017-11-02T17:54:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6af6c4e47b327c0d1bb031161c3e58260ebc04d3","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Efosaok/More-Recipes/pulls/10/commits","review_comments_url":"https://api.github.com/repos/Efosaok/More-Recipes/pulls/10/comments","review_comment_url":"https://api.github.com/repos/Efosaok/More-Recipes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Efosaok/More-Recipes/issues/10/comments","statuses_url":"https://api.github.com/repos/Efosaok/More-Recipes/statuses/8c64f1624d4356dfe392169ef3816b695d1eed16","head":{"label":"Efosaok:development","ref":"development","sha":"8c64f1624d4356dfe392169ef3816b695d1eed16","user":{"login":"Efosaok","id":24938186,"avatar_url":"https://avatars2.githubusercontent.com/u/24938186?v=4","gravatar_id":"","url":"https://api.github.com/users/Efosaok","html_url":"https://github.com/Efosaok","followers_url":"https://api.github.com/users/Efosaok/followers","following_url":"https://api.github.com/users/Efosaok/following{/other_user}","gists_url":"https://api.github.com/users/Efosaok/gists{/gist_id}","starred_url":"https://api.github.com/users/Efosaok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Efosaok/subscriptions","organizations_url":"https://api.github.com/users/Efosaok/orgs","repos_url":"https://api.github.com/users/Efosaok/repos","events_url":"https://api.github.com/users/Efosaok/events{/privacy}","received_events_url":"https://api.github.com/users/Efosaok/received_events","type":"User","site_admin":false},"repo":{"id":107499637,"name":"More-Recipes","full_name":"Efosaok/More-Recipes","owner":{"login":"Efosaok","id":24938186,"avatar_url":"https://avatars2.githubusercontent.com/u/24938186?v=4","gravatar_id":"","url":"https://api.github.com/users/Efosaok","html_url":"https://github.com/Efosaok","followers_url":"https://api.github.com/users/Efosaok/followers","following_url":"https://api.github.com/users/Efosaok/following{/other_user}","gists_url":"https://api.github.com/users/Efosaok/gists{/gist_id}","starred_url":"https://api.github.com/users/Efosaok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Efosaok/subscriptions","organizations_url":"https://api.github.com/users/Efosaok/orgs","repos_url":"https://api.github.com/users/Efosaok/repos","events_url":"https://api.github.com/users/Efosaok/events{/privacy}","received_events_url":"https://api.github.com/users/Efosaok/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Efosaok/More-Recipes","description":"More-Recipes provides a platform for users to share the awesome and exciting  recipe ideas they have invented or learnt.  Suppose a user comes up with a recipe,  he/she can post it on More-Recipes and  get feedback in form of reviews and votes from other users who explore that recipe. Users can also keep a list of their favorite recipes on the application.","fork":false,"url":"https://api.github.com/repos/Efosaok/More-Recipes","forks_url":"https://api.github.com/repos/Efosaok/More-Recipes/forks","keys_url":"https://api.github.com/repos/Efosaok/More-Recipes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Efosaok/More-Recipes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Efosaok/More-Recipes/teams","hooks_url":"https://api.github.com/repos/Efosaok/More-Recipes/hooks","issue_events_url":"https://api.github.com/repos/Efosaok/More-Recipes/issues/events{/number}","events_url":"https://api.github.com/repos/Efosaok/More-Recipes/events","assignees_url":"https://api.github.com/repos/Efosaok/More-Recipes/assignees{/user}","branches_url":"https://api.github.com/repos/Efosaok/More-Recipes/branches{/branch}","tags_url":"https://api.github.com/repos/Efosaok/More-Recipes/tags","blobs_url":"https://api.github.com/repos/Efosaok/More-Recipes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Efosaok/More-Recipes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Efosaok/More-Recipes/git/refs{/sha}","trees_url":"https://api.github.com/repos/Efosaok/More-Recipes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Efosaok/More-Recipes/statuses/{sha}","languages_url":"https://api.github.com/repos/Efosaok/More-Recipes/languages","stargazers_url":"https://api.github.com/repos/Efosaok/More-Recipes/stargazers","contributors_url":"https://api.github.com/repos/Efosaok/More-Recipes/contributors","subscribers_url":"https://api.github.com/repos/Efosaok/More-Recipes/subscribers","subscription_url":"https://api.github.com/repos/Efosaok/More-Recipes/subscription","commits_url":"https://api.github.com/repos/Efosaok/More-Recipes/commits{/sha}","git_commits_url":"https://api.github.com/repos/Efosaok/More-Recipes/git/commits{/sha}","comments_url":"https://api.github.com/repos/Efosaok/More-Recipes/comments{/number}","issue_comment_url":"https://api.github.com/repos/Efosaok/More-Recipes/issues/comments{/number}","contents_url":"https://api.github.com/repos/Efosaok/More-Recipes/contents/{+path}","compare_url":"https://api.github.com/repos/Efosaok/More-Recipes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Efosaok/More-Recipes/merges","archive_url":"https://api.github.com/repos/Efosaok/More-Recipes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Efosaok/More-Recipes/downloads","issues_url":"https://api.github.com/repos/Efosaok/More-Recipes/issues{/number}","pulls_url":"https://api.github.com/repos/Efosaok/More-Recipes/pulls{/number}","milestones_url":"https://api.github.com/repos/Efosaok/More-Recipes/milestones{/number}","notifications_url":"https://api.github.com/repos/Efosaok/More-Recipes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Efosaok/More-Recipes/labels{/name}","releases_url":"https://api.github.com/repos/Efosaok/More-Recipes/releases{/id}","deployments_url":"https://api.github.com/repos/Efosaok/More-Recipes/deployments","created_at":"2017-10-19T04:51:29Z","updated_at":"2017-10-30T10:02:13Z","pushed_at":"2017-11-02T17:54:23Z","git_url":"git://github.com/Efosaok/More-Recipes.git","ssh_url":"git@github.com:Efosaok/More-Recipes.git","clone_url":"https://github.com/Efosaok/More-Recipes.git","svn_url":"https://github.com/Efosaok/More-Recipes","homepage":null,"size":13933,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"development"}},"base":{"label":"Efosaok:master","ref":"master","sha":"f9b904d7d50b80806d63f2a393fce1f6c0f7b4bb","user":{"login":"Efosaok","id":24938186,"avatar_url":"https://avatars2.githubusercontent.com/u/24938186?v=4","gravatar_id":"","url":"https://api.github.com/users/Efosaok","html_url":"https://github.com/Efosaok","followers_url":"https://api.github.com/users/Efosaok/followers","following_url":"https://api.github.com/users/Efosaok/following{/other_user}","gists_url":"https://api.github.com/users/Efosaok/gists{/gist_id}","starred_url":"https://api.github.com/users/Efosaok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Efosaok/subscriptions","organizations_url":"https://api.github.com/users/Efosaok/orgs","repos_url":"https://api.github.com/users/Efosaok/repos","events_url":"https://api.github.com/users/Efosaok/events{/privacy}","received_events_url":"https://api.github.com/users/Efosaok/received_events","type":"User","site_admin":false},"repo":{"id":107499637,"name":"More-Recipes","full_name":"Efosaok/More-Recipes","owner":{"login":"Efosaok","id":24938186,"avatar_url":"https://avatars2.githubusercontent.com/u/24938186?v=4","gravatar_id":"","url":"https://api.github.com/users/Efosaok","html_url":"https://github.com/Efosaok","followers_url":"https://api.github.com/users/Efosaok/followers","following_url":"https://api.github.com/users/Efosaok/following{/other_user}","gists_url":"https://api.github.com/users/Efosaok/gists{/gist_id}","starred_url":"https://api.github.com/users/Efosaok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Efosaok/subscriptions","organizations_url":"https://api.github.com/users/Efosaok/orgs","repos_url":"https://api.github.com/users/Efosaok/repos","events_url":"https://api.github.com/users/Efosaok/events{/privacy}","received_events_url":"https://api.github.com/users/Efosaok/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Efosaok/More-Recipes","description":"More-Recipes provides a platform for users to share the awesome and exciting  recipe ideas they have invented or learnt.  Suppose a user comes up with a recipe,  he/she can post it on More-Recipes and  get feedback in form of reviews and votes from other users who explore that recipe. Users can also keep a list of their favorite recipes on the application.","fork":false,"url":"https://api.github.com/repos/Efosaok/More-Recipes","forks_url":"https://api.github.com/repos/Efosaok/More-Recipes/forks","keys_url":"https://api.github.com/repos/Efosaok/More-Recipes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Efosaok/More-Recipes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Efosaok/More-Recipes/teams","hooks_url":"https://api.github.com/repos/Efosaok/More-Recipes/hooks","issue_events_url":"https://api.github.com/repos/Efosaok/More-Recipes/issues/events{/number}","events_url":"https://api.github.com/repos/Efosaok/More-Recipes/events","assignees_url":"https://api.github.com/repos/Efosaok/More-Recipes/assignees{/user}","branches_url":"https://api.github.com/repos/Efosaok/More-Recipes/branches{/branch}","tags_url":"https://api.github.com/repos/Efosaok/More-Recipes/tags","blobs_url":"https://api.github.com/repos/Efosaok/More-Recipes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Efosaok/More-Recipes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Efosaok/More-Recipes/git/refs{/sha}","trees_url":"https://api.github.com/repos/Efosaok/More-Recipes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Efosaok/More-Recipes/statuses/{sha}","languages_url":"https://api.github.com/repos/Efosaok/More-Recipes/languages","stargazers_url":"https://api.github.com/repos/Efosaok/More-Recipes/stargazers","contributors_url":"https://api.github.com/repos/Efosaok/More-Recipes/contributors","subscribers_url":"https://api.github.com/repos/Efosaok/More-Recipes/subscribers","subscription_url":"https://api.github.com/repos/Efosaok/More-Recipes/subscription","commits_url":"https://api.github.com/repos/Efosaok/More-Recipes/commits{/sha}","git_commits_url":"https://api.github.com/repos/Efosaok/More-Recipes/git/commits{/sha}","comments_url":"https://api.github.com/repos/Efosaok/More-Recipes/comments{/number}","issue_comment_url":"https://api.github.com/repos/Efosaok/More-Recipes/issues/comments{/number}","contents_url":"https://api.github.com/repos/Efosaok/More-Recipes/contents/{+path}","compare_url":"https://api.github.com/repos/Efosaok/More-Recipes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Efosaok/More-Recipes/merges","archive_url":"https://api.github.com/repos/Efosaok/More-Recipes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Efosaok/More-Recipes/downloads","issues_url":"https://api.github.com/repos/Efosaok/More-Recipes/issues{/number}","pulls_url":"https://api.github.com/repos/Efosaok/More-Recipes/pulls{/number}","milestones_url":"https://api.github.com/repos/Efosaok/More-Recipes/milestones{/number}","notifications_url":"https://api.github.com/repos/Efosaok/More-Recipes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Efosaok/More-Recipes/labels{/name}","releases_url":"https://api.github.com/repos/Efosaok/More-Recipes/releases{/id}","deployments_url":"https://api.github.com/repos/Efosaok/More-Recipes/deployments","created_at":"2017-10-19T04:51:29Z","updated_at":"2017-10-30T10:02:13Z","pushed_at":"2017-11-02T17:54:23Z","git_url":"git://github.com/Efosaok/More-Recipes.git","ssh_url":"git@github.com:Efosaok/More-Recipes.git","clone_url":"https://github.com/Efosaok/More-Recipes.git","svn_url":"https://github.com/Efosaok/More-Recipes","homepage":null,"size":13933,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/Efosaok/More-Recipes/pulls/10"},"html":{"href":"https://github.com/Efosaok/More-Recipes/pull/10"},"issue":{"href":"https://api.github.com/repos/Efosaok/More-Recipes/issues/10"},"comments":{"href":"https://api.github.com/repos/Efosaok/More-Recipes/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/Efosaok/More-Recipes/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/Efosaok/More-Recipes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Efosaok/More-Recipes/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/Efosaok/More-Recipes/statuses/8c64f1624d4356dfe392169ef3816b695d1eed16"}},"author_association":"OWNER"}}
{"actor":{"display_login":"houndci-bot"}}