Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ca97d7f7
Commit
ca97d7f7
authored
May 25, 2017
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the users method in api.js
parent
f35a5bba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
23 deletions
+11
-23
app/assets/javascripts/api.js
app/assets/javascripts/api.js
+11
-23
No files found.
app/assets/javascripts/api.js
View file @
ca97d7f7
...
@@ -24,18 +24,6 @@ const Api = {
...
@@ -24,18 +24,6 @@ const Api = {
.
done
(
group
=>
callback
(
group
));
.
done
(
group
=>
callback
(
group
));
},
},
users
:
function
(
search
,
options
,
callback
=
$
.
noop
)
{
var
url
=
Api
.
buildUrl
(
'
/autocomplete/users.json
'
);
return
$
.
ajax
({
url
,
data
:
$
.
extend
({
search
,
per_page
:
20
},
options
),
dataType
:
'
json
'
}).
done
(
callback
);
},
// Return groups list. Filtered by query
// Return groups list. Filtered by query
groups
(
query
,
options
,
callback
)
{
groups
(
query
,
options
,
callback
)
{
const
url
=
Api
.
buildUrl
(
Api
.
groupsPath
);
const
url
=
Api
.
buildUrl
(
Api
.
groupsPath
);
...
@@ -161,29 +149,29 @@ const Api = {
...
@@ -161,29 +149,29 @@ const Api = {
});
});
},
},
buildUrl
(
url
)
{
let
urlRoot
=
''
;
if
(
gon
.
relative_url_root
!=
null
)
{
urlRoot
=
gon
.
relative_url_root
;
}
return
urlRoot
+
url
.
replace
(
'
:version
'
,
gon
.
api_version
);
},
ldap_groups
(
query
,
provider
,
callback
)
{
ldap_groups
(
query
,
provider
,
callback
)
{
const
url
=
Api
.
buildUrl
(
this
.
ldapGroupsPath
).
replace
(
'
:provider
'
,
provider
);
const
url
=
Api
.
buildUrl
(
this
.
ldapGroupsPath
).
replace
(
'
:provider
'
,
provider
);
return
Api
.
wrapAjaxCall
({
return
Api
.
wrapAjaxCall
({
url
:
url
,
url
,
data
:
Object
.
assign
({
data
:
Object
.
assign
({
private_token
:
gon
.
api_token
,
private_token
:
gon
.
api_token
,
search
:
query
,
search
:
query
,
per_page
:
20
,
per_page
:
20
,
active
:
true
active
:
true
,
}),
}),
dataType
:
'
json
'
dataType
:
'
json
'
,
})
})
.
done
(
groups
=>
callback
(
groups
));
.
done
(
groups
=>
callback
(
groups
));
},
},
buildUrl
(
url
)
{
let
urlRoot
=
''
;
if
(
gon
.
relative_url_root
!=
null
)
{
urlRoot
=
gon
.
relative_url_root
;
}
return
urlRoot
+
url
.
replace
(
'
:version
'
,
gon
.
api_version
);
},
wrapAjaxCall
(
options
)
{
wrapAjaxCall
(
options
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
// jQuery 2 is not Promises/A+ compatible (missing catch)
// jQuery 2 is not Promises/A+ compatible (missing catch)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment