{"action":"created","comment":{"url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/pulls/comments/218796776","pull_request_review_id":156811669,"id":218796776,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxODc5Njc3Ng==","diff_hunk":"@@ -0,0 +1,114 @@\n+import { push } from 'connected-react-router';\n+import {\n+  GET_USERS_REQUEST,\n+  GET_USERS_SUCCESS,\n+  GET_USERS_FAILURE,\n+  DELETE_USER_REQUEST,\n+  DELETE_USER_SUCCESS,\n+  DELETE_USER_FAILURE,\n+  FILTER_USER_SUCCESS,\n+  GET_USER_REQUEST,\n+  GET_USER_SUCCESS,\n+  GET_USER_FAILURE,\n+  UPDATE_USER_REQUEST,\n+  UPDATE_USER_SUCCESS,\n+  UPDATE_USER_FAILURE,\n+  GET_USERS_COUNT_REQUEST,\n+  GET_USERS_COUNT_SUCCESS,\n+  GET_USERS_COUNT_FAILURE,\n+} from '../constants/actionTypes';\n+import { API } from '../constants/endpoints';\n+import { CALL_API } from '../constants/variables';\n+import { logout } from './auth.actions';\n+\n+/**\n+ * GetUsers API handler\n+ *\n+ * @param {Number} page\n+ */\n+export const getUsers = (page = 1) => ({\n+  [CALL_API]: {\n+    method: 'get',\n+    types: [GET_USERS_REQUEST, GET_USERS_SUCCESS, GET_USERS_FAILURE],\n+    endpoint: `${API.URL + API.USERS.GET}?_page=${page}`,\n+  },\n+});\n+\n+/**\n+ * GetUsers count API handler for pagination\n+ *\n+ * @param {Number} page\n+ */\n+export const getUsersCount = () => ({\n+  [CALL_API]: {\n+    method: 'get',\n+    types: [GET_USERS_COUNT_REQUEST, GET_USERS_COUNT_SUCCESS, GET_USERS_COUNT_FAILURE],\n+    endpoint: API.URL + API.USERS.GET,\n+  },\n+});\n+\n+/**\n+ * Get single API handler\n+ * @param {Number} id\n+ */\n+export const getUser = id => ({\n+  [CALL_API]: {\n+    method: 'get',\n+    types: [GET_USER_REQUEST, GET_USER_SUCCESS, GET_USER_FAILURE],\n+    endpoint: API.URL + API.USERS.GET + id,\n+  },\n+});\n+\n+/**\n+ * GetUsers API handler\n+ * @params {Number} id\n+ * @params {Boolean} isCurrent\n+ */\n+export const deleteUser = (id, isCurrent) => {\n+  const action = isCurrent\n+    ? { type: 'logout', action: logout }\n+    : { type: 'getUsers', action: getUsers };\n+\n+  return {\n+    [CALL_API]: {\n+      method: 'delete',\n+      types: [DELETE_USER_REQUEST, DELETE_USER_SUCCESS, DELETE_USER_FAILURE, action],\n+      endpoint: API.URL + API.USERS.DELETE + id,\n+    },\n+  };\n+};\n+\n+/**\n+ * Filter User handler handler\n+ * @param {String} name\n+ */\n+export const filterUser = name => dispatch => {\n+  dispatch({ type: FILTER_USER_SUCCESS, name });\n+};\n+\n+/**\n+ * Update User API handler\n+ * @param {Number} id\n+ * @param {String} name\n+ * @param {String} email\n+ * @param {String} password\n+ * @param {Boolean} isCurrentUserRoleChange\n+ */\n+export const updateUser = (id, name, email, password, role, isCurrentUserRoleChange) => {\n+  const actions = [UPDATE_USER_REQUEST, UPDATE_USER_SUCCESS, UPDATE_USER_FAILURE];\n+  if (isCurrentUserRoleChange) {\n+    actions.push({ type: 'logout', action: logout });\n+  } else {\n+    actions.push({ type: 'redirect', action: push('/users') });","path":"src/actions/users.actions.js","position":102,"original_position":102,"commit_id":"8d7887bc22f5b07bd9c2500951d30bdfde7f50fe","original_commit_id":"8d7887bc22f5b07bd9c2500951d30bdfde7f50fe","user":{"login":"rodriguezmanu","id":1910226,"node_id":"MDQ6VXNlcjE5MTAyMjY=","avatar_url":"https://avatars0.githubusercontent.com/u/1910226?v=4","gravatar_id":"","url":"https://api.github.com/users/rodriguezmanu","html_url":"https://github.com/rodriguezmanu","followers_url":"https://api.github.com/users/rodriguezmanu/followers","following_url":"https://api.github.com/users/rodriguezmanu/following{/other_user}","gists_url":"https://api.github.com/users/rodriguezmanu/gists{/gist_id}","starred_url":"https://api.github.com/users/rodriguezmanu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodriguezmanu/subscriptions","organizations_url":"https://api.github.com/users/rodriguezmanu/orgs","repos_url":"https://api.github.com/users/rodriguezmanu/repos","events_url":"https://api.github.com/users/rodriguezmanu/events{/privacy}","received_events_url":"https://api.github.com/users/rodriguezmanu/received_events","type":"User","site_admin":false},"body":"if the current user change the role, have to logout , otherwise redirect to user listing page","created_at":"2018-09-19T13:12:34Z","updated_at":"2018-09-19T13:12:35Z","html_url":"https://github.com/rodriguezmanu/crud-users-react-redux/pull/1#discussion_r218796776","pull_request_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/pulls/1","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/pulls/comments/218796776"},"html":{"href":"https://github.com/rodriguezmanu/crud-users-react-redux/pull/1#discussion_r218796776"},"pull_request":{"href":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/pulls/1","id":215724820,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1NzI0ODIw","html_url":"https://github.com/rodriguezmanu/crud-users-react-redux/pull/1","diff_url":"https://github.com/rodriguezmanu/crud-users-react-redux/pull/1.diff","patch_url":"https://github.com/rodriguezmanu/crud-users-react-redux/pull/1.patch","issue_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/issues/1","number":1,"state":"open","locked":false,"title":"Self PR","user":{"login":"rodriguezmanu","id":1910226,"node_id":"MDQ6VXNlcjE5MTAyMjY=","avatar_url":"https://avatars0.githubusercontent.com/u/1910226?v=4","gravatar_id":"","url":"https://api.github.com/users/rodriguezmanu","html_url":"https://github.com/rodriguezmanu","followers_url":"https://api.github.com/users/rodriguezmanu/followers","following_url":"https://api.github.com/users/rodriguezmanu/following{/other_user}","gists_url":"https://api.github.com/users/rodriguezmanu/gists{/gist_id}","starred_url":"https://api.github.com/users/rodriguezmanu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodriguezmanu/subscriptions","organizations_url":"https://api.github.com/users/rodriguezmanu/orgs","repos_url":"https://api.github.com/users/rodriguezmanu/repos","events_url":"https://api.github.com/users/rodriguezmanu/events{/privacy}","received_events_url":"https://api.github.com/users/rodriguezmanu/received_events","type":"User","site_admin":false},"body":"Self Pr","created_at":"2018-09-14T22:22:00Z","updated_at":"2018-09-19T13:12:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ed5f8ee1c6a138a05b21836b5108724288a03bd8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/pulls/1/commits","review_comments_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/pulls/1/comments","review_comment_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/issues/1/comments","statuses_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/statuses/8d7887bc22f5b07bd9c2500951d30bdfde7f50fe","head":{"label":"rodriguezmanu:dev","ref":"dev","sha":"8d7887bc22f5b07bd9c2500951d30bdfde7f50fe","user":{"login":"rodriguezmanu","id":1910226,"node_id":"MDQ6VXNlcjE5MTAyMjY=","avatar_url":"https://avatars0.githubusercontent.com/u/1910226?v=4","gravatar_id":"","url":"https://api.github.com/users/rodriguezmanu","html_url":"https://github.com/rodriguezmanu","followers_url":"https://api.github.com/users/rodriguezmanu/followers","following_url":"https://api.github.com/users/rodriguezmanu/following{/other_user}","gists_url":"https://api.github.com/users/rodriguezmanu/gists{/gist_id}","starred_url":"https://api.github.com/users/rodriguezmanu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodriguezmanu/subscriptions","organizations_url":"https://api.github.com/users/rodriguezmanu/orgs","repos_url":"https://api.github.com/users/rodriguezmanu/repos","events_url":"https://api.github.com/users/rodriguezmanu/events{/privacy}","received_events_url":"https://api.github.com/users/rodriguezmanu/received_events","type":"User","site_admin":false},"repo":{"id":146815876,"node_id":"MDEwOlJlcG9zaXRvcnkxNDY4MTU4NzY=","name":"crud-users-react-redux","full_name":"rodriguezmanu/crud-users-react-redux","private":false,"owner":{"login":"rodriguezmanu","id":1910226,"node_id":"MDQ6VXNlcjE5MTAyMjY=","avatar_url":"https://avatars0.githubusercontent.com/u/1910226?v=4","gravatar_id":"","url":"https://api.github.com/users/rodriguezmanu","html_url":"https://github.com/rodriguezmanu","followers_url":"https://api.github.com/users/rodriguezmanu/followers","following_url":"https://api.github.com/users/rodriguezmanu/following{/other_user}","gists_url":"https://api.github.com/users/rodriguezmanu/gists{/gist_id}","starred_url":"https://api.github.com/users/rodriguezmanu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodriguezmanu/subscriptions","organizations_url":"https://api.github.com/users/rodriguezmanu/orgs","repos_url":"https://api.github.com/users/rodriguezmanu/repos","events_url":"https://api.github.com/users/rodriguezmanu/events{/privacy}","received_events_url":"https://api.github.com/users/rodriguezmanu/received_events","type":"User","site_admin":false},"html_url":"https://github.com/rodriguezmanu/crud-users-react-redux","description":null,"fork":false,"url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux","forks_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/forks","keys_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/teams","hooks_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/hooks","issue_events_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/issues/events{/number}","events_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/events","assignees_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/assignees{/user}","branches_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/branches{/branch}","tags_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/tags","blobs_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/git/refs{/sha}","trees_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/statuses/{sha}","languages_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/languages","stargazers_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/stargazers","contributors_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/contributors","subscribers_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/subscribers","subscription_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/subscription","commits_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/commits{/sha}","git_commits_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/git/commits{/sha}","comments_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/comments{/number}","issue_comment_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/issues/comments{/number}","contents_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/contents/{+path}","compare_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/merges","archive_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/downloads","issues_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/issues{/number}","pulls_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/pulls{/number}","milestones_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/milestones{/number}","notifications_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/labels{/name}","releases_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/releases{/id}","deployments_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/deployments","created_at":"2018-08-30T23:07:10Z","updated_at":"2018-09-12T16:34:48Z","pushed_at":"2018-09-14T22:22:01Z","git_url":"git://github.com/rodriguezmanu/crud-users-react-redux.git","ssh_url":"git@github.com:rodriguezmanu/crud-users-react-redux.git","clone_url":"https://github.com/rodriguezmanu/crud-users-react-redux.git","svn_url":"https://github.com/rodriguezmanu/crud-users-react-redux","homepage":"https://crud-user-app.herokuapp.com/","size":195,"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":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"rodriguezmanu:self-pr","ref":"self-pr","sha":"c4d5ca00d865c214ee42c9fb360bca8f51f7f3be","user":{"login":"rodriguezmanu","id":1910226,"node_id":"MDQ6VXNlcjE5MTAyMjY=","avatar_url":"https://avatars0.githubusercontent.com/u/1910226?v=4","gravatar_id":"","url":"https://api.github.com/users/rodriguezmanu","html_url":"https://github.com/rodriguezmanu","followers_url":"https://api.github.com/users/rodriguezmanu/followers","following_url":"https://api.github.com/users/rodriguezmanu/following{/other_user}","gists_url":"https://api.github.com/users/rodriguezmanu/gists{/gist_id}","starred_url":"https://api.github.com/users/rodriguezmanu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodriguezmanu/subscriptions","organizations_url":"https://api.github.com/users/rodriguezmanu/orgs","repos_url":"https://api.github.com/users/rodriguezmanu/repos","events_url":"https://api.github.com/users/rodriguezmanu/events{/privacy}","received_events_url":"https://api.github.com/users/rodriguezmanu/received_events","type":"User","site_admin":false},"repo":{"id":146815876,"node_id":"MDEwOlJlcG9zaXRvcnkxNDY4MTU4NzY=","name":"crud-users-react-redux","full_name":"rodriguezmanu/crud-users-react-redux","private":false,"owner":{"login":"rodriguezmanu","id":1910226,"node_id":"MDQ6VXNlcjE5MTAyMjY=","avatar_url":"https://avatars0.githubusercontent.com/u/1910226?v=4","gravatar_id":"","url":"https://api.github.com/users/rodriguezmanu","html_url":"https://github.com/rodriguezmanu","followers_url":"https://api.github.com/users/rodriguezmanu/followers","following_url":"https://api.github.com/users/rodriguezmanu/following{/other_user}","gists_url":"https://api.github.com/users/rodriguezmanu/gists{/gist_id}","starred_url":"https://api.github.com/users/rodriguezmanu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodriguezmanu/subscriptions","organizations_url":"https://api.github.com/users/rodriguezmanu/orgs","repos_url":"https://api.github.com/users/rodriguezmanu/repos","events_url":"https://api.github.com/users/rodriguezmanu/events{/privacy}","received_events_url":"https://api.github.com/users/rodriguezmanu/received_events","type":"User","site_admin":false},"html_url":"https://github.com/rodriguezmanu/crud-users-react-redux","description":null,"fork":false,"url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux","forks_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/forks","keys_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/teams","hooks_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/hooks","issue_events_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/issues/events{/number}","events_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/events","assignees_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/assignees{/user}","branches_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/branches{/branch}","tags_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/tags","blobs_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/git/refs{/sha}","trees_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/statuses/{sha}","languages_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/languages","stargazers_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/stargazers","contributors_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/contributors","subscribers_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/subscribers","subscription_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/subscription","commits_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/commits{/sha}","git_commits_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/git/commits{/sha}","comments_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/comments{/number}","issue_comment_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/issues/comments{/number}","contents_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/contents/{+path}","compare_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/merges","archive_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/downloads","issues_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/issues{/number}","pulls_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/pulls{/number}","milestones_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/milestones{/number}","notifications_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/labels{/name}","releases_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/releases{/id}","deployments_url":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/deployments","created_at":"2018-08-30T23:07:10Z","updated_at":"2018-09-12T16:34:48Z","pushed_at":"2018-09-14T22:22:01Z","git_url":"git://github.com/rodriguezmanu/crud-users-react-redux.git","ssh_url":"git@github.com:rodriguezmanu/crud-users-react-redux.git","clone_url":"https://github.com/rodriguezmanu/crud-users-react-redux.git","svn_url":"https://github.com/rodriguezmanu/crud-users-react-redux","homepage":"https://crud-user-app.herokuapp.com/","size":195,"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":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/pulls/1"},"html":{"href":"https://github.com/rodriguezmanu/crud-users-react-redux/pull/1"},"issue":{"href":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/issues/1"},"comments":{"href":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/rodriguezmanu/crud-users-react-redux/statuses/8d7887bc22f5b07bd9c2500951d30bdfde7f50fe"}},"author_association":"OWNER"}}
{"actor":{"display_login":"rodriguezmanu"}}