Refactor Access List.

- Derive Team Roles without making extra API call.
- Consistent variable naming convention use camelCase.
- More informative error display.
This commit is contained in:
Kia Lam
2019-03-01 10:12:36 -05:00
parent a3a80bc23e
commit bf7e6201a2
5 changed files with 62 additions and 114 deletions

View File

@@ -6,7 +6,6 @@ const API_CONFIG = `${API_V2}config/`;
const API_ORGANIZATIONS = `${API_V2}organizations/`;
const API_INSTANCE_GROUPS = `${API_V2}instance_groups/`;
const API_USERS = `${API_V2}users/`;
const API_TEAMS = `${API_V2}teams/`;
const LOGIN_CONTENT_TYPE = 'application/x-www-form-urlencoded';
@@ -127,18 +126,6 @@ class APIClient {
return this.http.get(endpoint);
}
getUserTeams (id) {
const endpoint = `${API_USERS}${id}/teams/`;
return this.http.get(endpoint);
}
getTeamRoles (id) {
const endpoint = `${API_TEAMS}${id}/roles/`;
return this.http.get(endpoint);
}
}
export default APIClient;