{"action":"created","comment":{"url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/pulls/comments/60949915","id":60949915,"diff_hunk":"@@ -0,0 +1,71 @@\n+TemplateController('search_box', {\n+  private: {\n+    currentSearchFieldIndex: 0 // email by default\n+  },\n+  onCreated(){\n+    this.formatOK = function (fieldName, format,value) {\n+      let hasError = true;\n+      let errMssg = \"\";\n+      switch (format) {\n+        case \"string\":\n+          if (value.length === 0 || //accept empty\n+              isNaN(value) )\n+          {\n+            hasError = false;\n+          }\n+          break;\n+        case \"integer\":\n+          if (!isNaN(value))\n+          {\n+            hasError = false;\n+          }\n+          break;\n+        default:\n+          errMssg = \"incorrect format\";\n+\n+      }\n+      if (hasError)\n+      {\n+        errMssg = \"not a valid \"+fieldName;\n+      }\n+      return errMssg;\n+    },\n+\n+    this.goSearch =  function(event) {","path":"client/search_box.js","position":34,"original_position":34,"commit_id":"b721251ec5297f286a46a5b246aa92df5cb9375a","original_commit_id":"b721251ec5297f286a46a5b246aa92df5cb9375a","user":{"login":"DominikGuzei","id":172414,"avatar_url":"https://avatars.githubusercontent.com/u/172414?v=3","gravatar_id":"","url":"https://api.github.com/users/DominikGuzei","html_url":"https://github.com/DominikGuzei","followers_url":"https://api.github.com/users/DominikGuzei/followers","following_url":"https://api.github.com/users/DominikGuzei/following{/other_user}","gists_url":"https://api.github.com/users/DominikGuzei/gists{/gist_id}","starred_url":"https://api.github.com/users/DominikGuzei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DominikGuzei/subscriptions","organizations_url":"https://api.github.com/users/DominikGuzei/orgs","repos_url":"https://api.github.com/users/DominikGuzei/repos","events_url":"https://api.github.com/users/DominikGuzei/events{/privacy}","received_events_url":"https://api.github.com/users/DominikGuzei/received_events","type":"User","site_admin":false},"body":"you can add the `formatOk` and `goSearch` functions to the `private` object to make them available as helpers on the template instance! No need to define them within `onCreated`","created_at":"2016-04-25T17:08:20Z","updated_at":"2016-04-25T17:08:20Z","html_url":"https://github.com/iohkxavier/Invoice_Example_App/pull/21#discussion_r60949915","pull_request_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/pulls/comments/60949915"},"html":{"href":"https://github.com/iohkxavier/Invoice_Example_App/pull/21#discussion_r60949915"},"pull_request":{"href":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/pulls/21","id":67692952,"html_url":"https://github.com/iohkxavier/Invoice_Example_App/pull/21","diff_url":"https://github.com/iohkxavier/Invoice_Example_App/pull/21.diff","patch_url":"https://github.com/iohkxavier/Invoice_Example_App/pull/21.patch","issue_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/issues/21","number":21,"state":"open","locked":false,"title":"Feature/search","user":{"login":"iohkxavier","id":17818415,"avatar_url":"https://avatars.githubusercontent.com/u/17818415?v=3","gravatar_id":"","url":"https://api.github.com/users/iohkxavier","html_url":"https://github.com/iohkxavier","followers_url":"https://api.github.com/users/iohkxavier/followers","following_url":"https://api.github.com/users/iohkxavier/following{/other_user}","gists_url":"https://api.github.com/users/iohkxavier/gists{/gist_id}","starred_url":"https://api.github.com/users/iohkxavier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iohkxavier/subscriptions","organizations_url":"https://api.github.com/users/iohkxavier/orgs","repos_url":"https://api.github.com/users/iohkxavier/repos","events_url":"https://api.github.com/users/iohkxavier/events{/privacy}","received_events_url":"https://api.github.com/users/iohkxavier/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-25T09:55:50Z","updated_at":"2016-04-25T17:08:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e7486d295df79a647ee7cccfc3d36571772b0c89","assignee":{"login":"DominikGuzei","id":172414,"avatar_url":"https://avatars.githubusercontent.com/u/172414?v=3","gravatar_id":"","url":"https://api.github.com/users/DominikGuzei","html_url":"https://github.com/DominikGuzei","followers_url":"https://api.github.com/users/DominikGuzei/followers","following_url":"https://api.github.com/users/DominikGuzei/following{/other_user}","gists_url":"https://api.github.com/users/DominikGuzei/gists{/gist_id}","starred_url":"https://api.github.com/users/DominikGuzei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DominikGuzei/subscriptions","organizations_url":"https://api.github.com/users/DominikGuzei/orgs","repos_url":"https://api.github.com/users/DominikGuzei/repos","events_url":"https://api.github.com/users/DominikGuzei/events{/privacy}","received_events_url":"https://api.github.com/users/DominikGuzei/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/pulls/21/commits","review_comments_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/pulls/21/comments","review_comment_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/pulls/comments{/number}","comments_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/issues/21/comments","statuses_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/statuses/b721251ec5297f286a46a5b246aa92df5cb9375a","head":{"label":"iohkxavier:feature/search","ref":"feature/search","sha":"b721251ec5297f286a46a5b246aa92df5cb9375a","user":{"login":"iohkxavier","id":17818415,"avatar_url":"https://avatars.githubusercontent.com/u/17818415?v=3","gravatar_id":"","url":"https://api.github.com/users/iohkxavier","html_url":"https://github.com/iohkxavier","followers_url":"https://api.github.com/users/iohkxavier/followers","following_url":"https://api.github.com/users/iohkxavier/following{/other_user}","gists_url":"https://api.github.com/users/iohkxavier/gists{/gist_id}","starred_url":"https://api.github.com/users/iohkxavier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iohkxavier/subscriptions","organizations_url":"https://api.github.com/users/iohkxavier/orgs","repos_url":"https://api.github.com/users/iohkxavier/repos","events_url":"https://api.github.com/users/iohkxavier/events{/privacy}","received_events_url":"https://api.github.com/users/iohkxavier/received_events","type":"User","site_admin":false},"repo":{"id":54692075,"name":"Invoice_Example_App","full_name":"iohkxavier/Invoice_Example_App","owner":{"login":"iohkxavier","id":17818415,"avatar_url":"https://avatars.githubusercontent.com/u/17818415?v=3","gravatar_id":"","url":"https://api.github.com/users/iohkxavier","html_url":"https://github.com/iohkxavier","followers_url":"https://api.github.com/users/iohkxavier/followers","following_url":"https://api.github.com/users/iohkxavier/following{/other_user}","gists_url":"https://api.github.com/users/iohkxavier/gists{/gist_id}","starred_url":"https://api.github.com/users/iohkxavier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iohkxavier/subscriptions","organizations_url":"https://api.github.com/users/iohkxavier/orgs","repos_url":"https://api.github.com/users/iohkxavier/repos","events_url":"https://api.github.com/users/iohkxavier/events{/privacy}","received_events_url":"https://api.github.com/users/iohkxavier/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/iohkxavier/Invoice_Example_App","description":"Assignment: Invoice Example Application","fork":false,"url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App","forks_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/forks","keys_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/teams","hooks_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/hooks","issue_events_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/issues/events{/number}","events_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/events","assignees_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/assignees{/user}","branches_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/branches{/branch}","tags_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/tags","blobs_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/git/refs{/sha}","trees_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/statuses/{sha}","languages_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/languages","stargazers_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/stargazers","contributors_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/contributors","subscribers_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/subscribers","subscription_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/subscription","commits_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/commits{/sha}","git_commits_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/git/commits{/sha}","comments_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/comments{/number}","issue_comment_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/issues/comments{/number}","contents_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/contents/{+path}","compare_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/merges","archive_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/downloads","issues_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/issues{/number}","pulls_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/pulls{/number}","milestones_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/milestones{/number}","notifications_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/labels{/name}","releases_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/releases{/id}","deployments_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/deployments","created_at":"2016-03-25T03:30:01Z","updated_at":"2016-03-27T13:18:30Z","pushed_at":"2016-04-25T09:55:50Z","git_url":"git://github.com/iohkxavier/Invoice_Example_App.git","ssh_url":"git@github.com:iohkxavier/Invoice_Example_App.git","clone_url":"https://github.com/iohkxavier/Invoice_Example_App.git","svn_url":"https://github.com/iohkxavier/Invoice_Example_App","homepage":null,"size":40,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"develop"}},"base":{"label":"iohkxavier:develop","ref":"develop","sha":"e61f41b0173740e5d8381b4eb84d91c39b89bbc7","user":{"login":"iohkxavier","id":17818415,"avatar_url":"https://avatars.githubusercontent.com/u/17818415?v=3","gravatar_id":"","url":"https://api.github.com/users/iohkxavier","html_url":"https://github.com/iohkxavier","followers_url":"https://api.github.com/users/iohkxavier/followers","following_url":"https://api.github.com/users/iohkxavier/following{/other_user}","gists_url":"https://api.github.com/users/iohkxavier/gists{/gist_id}","starred_url":"https://api.github.com/users/iohkxavier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iohkxavier/subscriptions","organizations_url":"https://api.github.com/users/iohkxavier/orgs","repos_url":"https://api.github.com/users/iohkxavier/repos","events_url":"https://api.github.com/users/iohkxavier/events{/privacy}","received_events_url":"https://api.github.com/users/iohkxavier/received_events","type":"User","site_admin":false},"repo":{"id":54692075,"name":"Invoice_Example_App","full_name":"iohkxavier/Invoice_Example_App","owner":{"login":"iohkxavier","id":17818415,"avatar_url":"https://avatars.githubusercontent.com/u/17818415?v=3","gravatar_id":"","url":"https://api.github.com/users/iohkxavier","html_url":"https://github.com/iohkxavier","followers_url":"https://api.github.com/users/iohkxavier/followers","following_url":"https://api.github.com/users/iohkxavier/following{/other_user}","gists_url":"https://api.github.com/users/iohkxavier/gists{/gist_id}","starred_url":"https://api.github.com/users/iohkxavier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iohkxavier/subscriptions","organizations_url":"https://api.github.com/users/iohkxavier/orgs","repos_url":"https://api.github.com/users/iohkxavier/repos","events_url":"https://api.github.com/users/iohkxavier/events{/privacy}","received_events_url":"https://api.github.com/users/iohkxavier/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/iohkxavier/Invoice_Example_App","description":"Assignment: Invoice Example Application","fork":false,"url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App","forks_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/forks","keys_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/teams","hooks_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/hooks","issue_events_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/issues/events{/number}","events_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/events","assignees_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/assignees{/user}","branches_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/branches{/branch}","tags_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/tags","blobs_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/git/refs{/sha}","trees_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/statuses/{sha}","languages_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/languages","stargazers_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/stargazers","contributors_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/contributors","subscribers_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/subscribers","subscription_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/subscription","commits_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/commits{/sha}","git_commits_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/git/commits{/sha}","comments_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/comments{/number}","issue_comment_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/issues/comments{/number}","contents_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/contents/{+path}","compare_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/merges","archive_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/downloads","issues_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/issues{/number}","pulls_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/pulls{/number}","milestones_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/milestones{/number}","notifications_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/labels{/name}","releases_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/releases{/id}","deployments_url":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/deployments","created_at":"2016-03-25T03:30:01Z","updated_at":"2016-03-27T13:18:30Z","pushed_at":"2016-04-25T09:55:50Z","git_url":"git://github.com/iohkxavier/Invoice_Example_App.git","ssh_url":"git@github.com:iohkxavier/Invoice_Example_App.git","clone_url":"https://github.com/iohkxavier/Invoice_Example_App.git","svn_url":"https://github.com/iohkxavier/Invoice_Example_App","homepage":null,"size":40,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/pulls/21"},"html":{"href":"https://github.com/iohkxavier/Invoice_Example_App/pull/21"},"issue":{"href":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/issues/21"},"comments":{"href":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/iohkxavier/Invoice_Example_App/statuses/b721251ec5297f286a46a5b246aa92df5cb9375a"}}}}