aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/api
diff options
context:
space:
mode:
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>2017-04-13 12:00:23 +0200
committerGrégoire Aubert <gregaubert@users.noreply.github.com>2017-04-13 17:45:34 +0200
commit20893897816c27918c0c8e03c7ec8351c1fdc30c (patch)
treed2557d77f2a48382baebdc55cfb8ace09986483e /server/sonar-web/src/main/js/api
parent75199ada9ea789fee9532e3217c79282e35a9eca (diff)
downloadsonarqube-20893897816c27918c0c8e03c7ec8351c1fdc30c.tar.gz
sonarqube-20893897816c27918c0c8e03c7ec8351c1fdc30c.zip
SONAR-8994 Fix groups management for non default org
Diffstat (limited to 'server/sonar-web/src/main/js/api')
-rw-r--r--server/sonar-web/src/main/js/api/user_groups.js23
1 files changed, 11 insertions, 12 deletions
diff --git a/server/sonar-web/src/main/js/api/user_groups.js b/server/sonar-web/src/main/js/api/user_groups.js
index becfdb9c8a0..de515f119b0 100644
--- a/server/sonar-web/src/main/js/api/user_groups.js
+++ b/server/sonar-web/src/main/js/api/user_groups.js
@@ -20,24 +20,23 @@
//@flow
import { getJSON, post } from '../helpers/request';
-export function searchUsersGroups(query?: string, organization?: string) {
+export function searchUsersGroups(
+ data: { f?: string, organization?: string, p?: number, ps?: number, q?: string }
+) {
const url = '/api/user_groups/search';
- const data: { q?: string, organization?: string } = {};
- if (query) {
- data.q = query;
- }
- if (organization) {
- data.organization = organization;
- }
return getJSON(url, data);
}
-export function addUserToGroup(groupId: string, login: string) {
+export function addUserToGroup(
+ data: { id?: string, name?: string, login?: string, organization?: string }
+) {
const url = '/api/user_groups/add_user';
- return post(url, { id: groupId, login });
+ return post(url, data);
}
-export function removeUserFromGroup(groupId: string, login: string) {
+export function removeUserFromGroup(
+ data: { id?: string, name?: string, login?: string, organization?: string }
+) {
const url = '/api/user_groups/remove_user';
- return post(url, { id: groupId, login });
+ return post(url, data);
}