Abstract out Access List as shared component.

This commit is contained in:
Kia Lam
2019-02-26 13:23:34 -05:00
parent 3cd54c45eb
commit 1443625d89
6 changed files with 451 additions and 25 deletions

View File

@@ -66,10 +66,10 @@ class APIClient {
return this.http.post(API_ORGANIZATIONS, data);
}
getOrganzationAccessList (id) {
getOrganzationAccessList (id, params = {}) {
const endpoint = `${API_ORGANIZATIONS}${id}/access_list/`;
return this.http.get(endpoint);
return this.http.get(endpoint, { params });
}
getOrganizationDetails (id) {
@@ -84,24 +84,6 @@ class APIClient {
return this.http.get(endpoint, { params });
}
getOrganizationUserRoles (id) {
const endpoint = `${API_USERS}${id}/roles/`;
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);
}
getOrganizationNotifications (id, params = {}) {
const endpoint = `${API_ORGANIZATIONS}${id}/notification_templates/`;
@@ -139,6 +121,24 @@ class APIClient {
createInstanceGroups (url, id) {
return this.http.post(url, { id });
}
getUserRoles (id) {
const endpoint = `${API_USERS}${id}/roles/`;
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;