diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2018-08-22 13:49:25 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2018-08-22 20:21:22 +0200 |
commit | facddc67e65ce303e40e494d921a53446277cd43 (patch) | |
tree | 3a387503f001ae5be20f20c8c2a8f144f574ba3f /server/sonar-web/src/main/js/api | |
parent | 238191f069e82f40e0e3a89d7914481975bcb200 (diff) | |
download | sonarqube-facddc67e65ce303e40e494d921a53446277cd43.tar.gz sonarqube-facddc67e65ce303e40e494d921a53446277cd43.zip |
drop organization members from redux store (#637)
Diffstat (limited to 'server/sonar-web/src/main/js/api')
-rw-r--r-- | server/sonar-web/src/main/js/api/organizations.ts | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/server/sonar-web/src/main/js/api/organizations.ts b/server/sonar-web/src/main/js/api/organizations.ts index ffa4cb24fb2..78d8f63ac1c 100644 --- a/server/sonar-web/src/main/js/api/organizations.ts +++ b/server/sonar-web/src/main/js/api/organizations.ts @@ -19,7 +19,7 @@ */ import { getJSON, post, postJSON } from '../helpers/request'; import throwGlobalError from '../app/utils/throwGlobalError'; -import { Organization, OrganizationBase, Paging } from '../app/types'; +import { Organization, OrganizationBase, Paging, OrganizationMember } from '../app/types'; export function getOrganizations(data: { organizations?: string; @@ -69,16 +69,19 @@ export function searchMembers(data: { ps?: number; q?: string; selected?: string; -}): Promise<{ paging: Paging; users: Array<{ avatar?: string; login: string; name: string }> }> { - return getJSON('/api/organizations/search_members', data); +}): Promise<{ paging: Paging; users: OrganizationMember[] }> { + return getJSON('/api/organizations/search_members', data).catch(throwGlobalError); } -export function addMember(data: { login: string; organization: string }): Promise<any> { - return postJSON('/api/organizations/add_member', data).then(r => r.user); +export function addMember(data: { + login: string; + organization: string; +}): Promise<OrganizationMember> { + return postJSON('/api/organizations/add_member', data).then(r => r.user, throwGlobalError); } -export function removeMember(data: { login: string; organization: string }): Promise<void> { - return post('/api/organizations/remove_member', data); +export function removeMember(data: { login: string; organization: string }) { + return post('/api/organizations/remove_member', data).catch(throwGlobalError); } export interface OrganizationBilling { |