{"action":"created","comment":{"url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/comments/55502072","id":55502072,"diff_hunk":"@@ -83,7 +83,7 @@ exports.configure = function (app) {\n   winston.debug('Configuring routes');\n \n   // exposed to the outside without authentication\n-  app.get('/languages', users.getLanguages);\n+  app.get('/languages', users.languages);","path":"server/config/routes.js","position":5,"original_position":5,"commit_id":"02cf926834f5df5f6bf4ea39b6b4a8922dbb43d7","original_commit_id":"053666771a8198c423d8f8e77012dde2517345d6","user":{"login":"DedrickEnc","id":5418919,"avatar_url":"https://avatars.githubusercontent.com/u/5418919?v=3","gravatar_id":"","url":"https://api.github.com/users/DedrickEnc","html_url":"https://github.com/DedrickEnc","followers_url":"https://api.github.com/users/DedrickEnc/followers","following_url":"https://api.github.com/users/DedrickEnc/following{/other_user}","gists_url":"https://api.github.com/users/DedrickEnc/gists{/gist_id}","starred_url":"https://api.github.com/users/DedrickEnc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DedrickEnc/subscriptions","organizations_url":"https://api.github.com/users/DedrickEnc/orgs","repos_url":"https://api.github.com/users/DedrickEnc/repos","events_url":"https://api.github.com/users/DedrickEnc/events{/privacy}","received_events_url":"https://api.github.com/users/DedrickEnc/received_events","type":"User","site_admin":false},"body":"We discussed as a team, and we decided to use verb for API exposed methods.\r\nHere is an example : \r\n\r\n```\r\napp.post('/creditor_groups', creditorGroups.create); //the verb to create\r\napp.get('/creditor_groups', creditorGroups.list); //the verb to list\r\napp.get('/creditor_groups/:uuid', creditorGroups.detail); //the verb to detail\r\napp.put('/creditor_groups/:uuid', creditorGroups.update); //the verb to update\r\n```\r\nto languages is not a verb.","created_at":"2016-03-09T10:56:58Z","updated_at":"2016-03-09T10:56:58Z","html_url":"https://github.com/IMA-WorldHealth/bhima-2.X/pull/173#discussion_r55502072","pull_request_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/173","_links":{"self":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/comments/55502072"},"html":{"href":"https://github.com/IMA-WorldHealth/bhima-2.X/pull/173#discussion_r55502072"},"pull_request":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/173"}}},"pull_request":{"url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/173","id":61897783,"html_url":"https://github.com/IMA-WorldHealth/bhima-2.X/pull/173","diff_url":"https://github.com/IMA-WorldHealth/bhima-2.X/pull/173.diff","patch_url":"https://github.com/IMA-WorldHealth/bhima-2.X/pull/173.patch","issue_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/173","number":173,"state":"open","locked":false,"title":"chore(languages): implement a LanguageService","user":{"login":"jniles","id":896472,"avatar_url":"https://avatars.githubusercontent.com/u/896472?v=3","gravatar_id":"","url":"https://api.github.com/users/jniles","html_url":"https://github.com/jniles","followers_url":"https://api.github.com/users/jniles/followers","following_url":"https://api.github.com/users/jniles/following{/other_user}","gists_url":"https://api.github.com/users/jniles/gists{/gist_id}","starred_url":"https://api.github.com/users/jniles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jniles/subscriptions","organizations_url":"https://api.github.com/users/jniles/orgs","repos_url":"https://api.github.com/users/jniles/repos","events_url":"https://api.github.com/users/jniles/events{/privacy}","received_events_url":"https://api.github.com/users/jniles/received_events","type":"User","site_admin":false},"body":"This commit implements a LanguageService, responsible to managing the\r\nlanguages and locales throughout the application. In order to do this,\r\nseveral changes have been made:\r\n 1. The database `language` table now contains the locales for\r\n angular-moment and tmhDynamicLocale.  This requires a database rebuild.\r\n 2. Three controllers responsible for languages now use LanguageService.\r\n These are:\r\n  1. ApplicationController\r\n  2. LoginController\r\n  3. SettingsController\r\n\r\nUSAGE\r\nIf you want to use the LanguageService to display or set languages from\r\na controller, the API is quite simple.  Languages are loaded from the\r\ndatabase on startup, and can be accessed via the `read()` function as\r\nshown below.\r\n\r\n```js\r\nangular.module('bhima.controllers')\r\n.controller('SomeController', [ 'LanguageService', function (Languages) {\r\n  var vm = this;\r\n\r\n  // reading languages from the service\r\n  Languages.read()\r\n  .then(function (languages) {\r\n    vm.languages = languages;\r\n  });\r\n\r\n  // setting the application language based on a locale key\r\n  Languages.set(key);\r\n\r\n  // get the current language\r\n  var languageKey = Languages.get();\r\n}]);\r\n```\r\n\r\nCloses #160.","created_at":"2016-03-07T10:24:42Z","updated_at":"2016-03-09T10:56:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1fd1992a96549f5f31bb5b3205f6b714efad4678","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/173/commits","review_comments_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/173/comments","review_comment_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/comments{/number}","comments_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/173/comments","statuses_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/statuses/02cf926834f5df5f6bf4ea39b6b4a8922dbb43d7","head":{"label":"jniles:feature-language-service","ref":"feature-language-service","sha":"02cf926834f5df5f6bf4ea39b6b4a8922dbb43d7","user":{"login":"jniles","id":896472,"avatar_url":"https://avatars.githubusercontent.com/u/896472?v=3","gravatar_id":"","url":"https://api.github.com/users/jniles","html_url":"https://github.com/jniles","followers_url":"https://api.github.com/users/jniles/followers","following_url":"https://api.github.com/users/jniles/following{/other_user}","gists_url":"https://api.github.com/users/jniles/gists{/gist_id}","starred_url":"https://api.github.com/users/jniles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jniles/subscriptions","organizations_url":"https://api.github.com/users/jniles/orgs","repos_url":"https://api.github.com/users/jniles/repos","events_url":"https://api.github.com/users/jniles/events{/privacy}","received_events_url":"https://api.github.com/users/jniles/received_events","type":"User","site_admin":false},"repo":{"id":49059888,"name":"bhima-2.X","full_name":"jniles/bhima-2.X","owner":{"login":"jniles","id":896472,"avatar_url":"https://avatars.githubusercontent.com/u/896472?v=3","gravatar_id":"","url":"https://api.github.com/users/jniles","html_url":"https://github.com/jniles","followers_url":"https://api.github.com/users/jniles/followers","following_url":"https://api.github.com/users/jniles/following{/other_user}","gists_url":"https://api.github.com/users/jniles/gists{/gist_id}","starred_url":"https://api.github.com/users/jniles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jniles/subscriptions","organizations_url":"https://api.github.com/users/jniles/orgs","repos_url":"https://api.github.com/users/jniles/repos","events_url":"https://api.github.com/users/jniles/events{/privacy}","received_events_url":"https://api.github.com/users/jniles/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jniles/bhima-2.X","description":"A fresh start for bhima to remove large commits","fork":true,"url":"https://api.github.com/repos/jniles/bhima-2.X","forks_url":"https://api.github.com/repos/jniles/bhima-2.X/forks","keys_url":"https://api.github.com/repos/jniles/bhima-2.X/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jniles/bhima-2.X/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jniles/bhima-2.X/teams","hooks_url":"https://api.github.com/repos/jniles/bhima-2.X/hooks","issue_events_url":"https://api.github.com/repos/jniles/bhima-2.X/issues/events{/number}","events_url":"https://api.github.com/repos/jniles/bhima-2.X/events","assignees_url":"https://api.github.com/repos/jniles/bhima-2.X/assignees{/user}","branches_url":"https://api.github.com/repos/jniles/bhima-2.X/branches{/branch}","tags_url":"https://api.github.com/repos/jniles/bhima-2.X/tags","blobs_url":"https://api.github.com/repos/jniles/bhima-2.X/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jniles/bhima-2.X/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jniles/bhima-2.X/git/refs{/sha}","trees_url":"https://api.github.com/repos/jniles/bhima-2.X/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jniles/bhima-2.X/statuses/{sha}","languages_url":"https://api.github.com/repos/jniles/bhima-2.X/languages","stargazers_url":"https://api.github.com/repos/jniles/bhima-2.X/stargazers","contributors_url":"https://api.github.com/repos/jniles/bhima-2.X/contributors","subscribers_url":"https://api.github.com/repos/jniles/bhima-2.X/subscribers","subscription_url":"https://api.github.com/repos/jniles/bhima-2.X/subscription","commits_url":"https://api.github.com/repos/jniles/bhima-2.X/commits{/sha}","git_commits_url":"https://api.github.com/repos/jniles/bhima-2.X/git/commits{/sha}","comments_url":"https://api.github.com/repos/jniles/bhima-2.X/comments{/number}","issue_comment_url":"https://api.github.com/repos/jniles/bhima-2.X/issues/comments{/number}","contents_url":"https://api.github.com/repos/jniles/bhima-2.X/contents/{+path}","compare_url":"https://api.github.com/repos/jniles/bhima-2.X/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jniles/bhima-2.X/merges","archive_url":"https://api.github.com/repos/jniles/bhima-2.X/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jniles/bhima-2.X/downloads","issues_url":"https://api.github.com/repos/jniles/bhima-2.X/issues{/number}","pulls_url":"https://api.github.com/repos/jniles/bhima-2.X/pulls{/number}","milestones_url":"https://api.github.com/repos/jniles/bhima-2.X/milestones{/number}","notifications_url":"https://api.github.com/repos/jniles/bhima-2.X/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jniles/bhima-2.X/labels{/name}","releases_url":"https://api.github.com/repos/jniles/bhima-2.X/releases{/id}","deployments_url":"https://api.github.com/repos/jniles/bhima-2.X/deployments","created_at":"2016-01-05T10:44:42Z","updated_at":"2016-01-05T10:44:44Z","pushed_at":"2016-03-09T10:39:46Z","git_url":"git://github.com/jniles/bhima-2.X.git","ssh_url":"git@github.com:jniles/bhima-2.X.git","clone_url":"https://github.com/jniles/bhima-2.X.git","svn_url":"https://github.com/jniles/bhima-2.X","homepage":null,"size":2463,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"IMA-WorldHealth:master","ref":"master","sha":"d654ed45cfe2de2f01dae570aece3de211cf2b45","user":{"login":"IMA-WorldHealth","id":5330583,"avatar_url":"https://avatars.githubusercontent.com/u/5330583?v=3","gravatar_id":"","url":"https://api.github.com/users/IMA-WorldHealth","html_url":"https://github.com/IMA-WorldHealth","followers_url":"https://api.github.com/users/IMA-WorldHealth/followers","following_url":"https://api.github.com/users/IMA-WorldHealth/following{/other_user}","gists_url":"https://api.github.com/users/IMA-WorldHealth/gists{/gist_id}","starred_url":"https://api.github.com/users/IMA-WorldHealth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IMA-WorldHealth/subscriptions","organizations_url":"https://api.github.com/users/IMA-WorldHealth/orgs","repos_url":"https://api.github.com/users/IMA-WorldHealth/repos","events_url":"https://api.github.com/users/IMA-WorldHealth/events{/privacy}","received_events_url":"https://api.github.com/users/IMA-WorldHealth/received_events","type":"Organization","site_admin":false},"repo":{"id":49052669,"name":"bhima-2.X","full_name":"IMA-WorldHealth/bhima-2.X","owner":{"login":"IMA-WorldHealth","id":5330583,"avatar_url":"https://avatars.githubusercontent.com/u/5330583?v=3","gravatar_id":"","url":"https://api.github.com/users/IMA-WorldHealth","html_url":"https://github.com/IMA-WorldHealth","followers_url":"https://api.github.com/users/IMA-WorldHealth/followers","following_url":"https://api.github.com/users/IMA-WorldHealth/following{/other_user}","gists_url":"https://api.github.com/users/IMA-WorldHealth/gists{/gist_id}","starred_url":"https://api.github.com/users/IMA-WorldHealth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IMA-WorldHealth/subscriptions","organizations_url":"https://api.github.com/users/IMA-WorldHealth/orgs","repos_url":"https://api.github.com/users/IMA-WorldHealth/repos","events_url":"https://api.github.com/users/IMA-WorldHealth/events{/privacy}","received_events_url":"https://api.github.com/users/IMA-WorldHealth/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/IMA-WorldHealth/bhima-2.X","description":"A fresh start for bhima to remove large commits","fork":false,"url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X","forks_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/forks","keys_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/teams","hooks_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/hooks","issue_events_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/events{/number}","events_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/events","assignees_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/assignees{/user}","branches_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/branches{/branch}","tags_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/tags","blobs_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/git/refs{/sha}","trees_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/statuses/{sha}","languages_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/languages","stargazers_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/stargazers","contributors_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/contributors","subscribers_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/subscribers","subscription_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/subscription","commits_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/commits{/sha}","git_commits_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/git/commits{/sha}","comments_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/comments{/number}","issue_comment_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/comments{/number}","contents_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/contents/{+path}","compare_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/merges","archive_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/downloads","issues_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues{/number}","pulls_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls{/number}","milestones_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/milestones{/number}","notifications_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/labels{/name}","releases_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/releases{/id}","deployments_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/deployments","created_at":"2016-01-05T08:30:30Z","updated_at":"2016-02-27T20:42:18Z","pushed_at":"2016-03-09T10:35:47Z","git_url":"git://github.com/IMA-WorldHealth/bhima-2.X.git","ssh_url":"git@github.com:IMA-WorldHealth/bhima-2.X.git","clone_url":"https://github.com/IMA-WorldHealth/bhima-2.X.git","svn_url":"https://github.com/IMA-WorldHealth/bhima-2.X","homepage":null,"size":2566,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":54,"forks":5,"open_issues":54,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/173"},"html":{"href":"https://github.com/IMA-WorldHealth/bhima-2.X/pull/173"},"issue":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/173"},"comments":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/173/comments"},"review_comments":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/173/comments"},"review_comment":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/173/commits"},"statuses":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/statuses/02cf926834f5df5f6bf4ea39b6b4a8922dbb43d7"}}}}