Commit 6def9128 authored by Phil Hughes's avatar Phil Hughes

Chganged approverUsers methods to use axios

parent 7c28e4cd
......@@ -182,14 +182,16 @@ const Api = {
approverUsers(search, options, callback = $.noop) {
const url = Api.buildUrl('/autocomplete/users.json');
return $.ajax({
url,
data: $.extend({
return axios.get(url, {
params: Object.assign({
search,
per_page: 20,
}, options),
dataType: 'json',
}).done(callback);
}).then(({ data }) => {
callback(data);
return data;
});
},
ldap_groups(query, provider, callback) {
......
......@@ -79,9 +79,9 @@ export default class ApproversSelect {
query: (query) => {
const fetchGroups = this.fetchGroups(query.term);
const fetchUsers = this.fetchUsers(query.term);
return $.when(fetchGroups, fetchUsers).then((groups, users) => {
return Promise.all([fetchGroups, fetchUsers]).then(([groups, users]) => {
const data = {
results: groups[0].concat(users[0]),
results: groups.concat(users),
};
return query.callback(data);
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment