diff options
author | Phil Hughes <me@iamphill.com> | 2018-01-25 16:40:31 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-01-30 09:12:56 +0000 |
commit | 9af1773f8d6b6633938c6732bf28de83a2b88cc3 (patch) | |
tree | 91f5f54f11b06593b385cf5950db587d6ec670be /app/assets/javascripts/lib/utils/users_cache.js | |
parent | 364395b36ff89924b70f7fc248c7103f26d525a4 (diff) | |
download | gitlab-ce-9af1773f8d6b6633938c6732bf28de83a2b88cc3.tar.gz |
Converted API.js to axios
Diffstat (limited to 'app/assets/javascripts/lib/utils/users_cache.js')
-rw-r--r-- | app/assets/javascripts/lib/utils/users_cache.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/assets/javascripts/lib/utils/users_cache.js b/app/assets/javascripts/lib/utils/users_cache.js index 88f8a622c00..b01ec6b81a3 100644 --- a/app/assets/javascripts/lib/utils/users_cache.js +++ b/app/assets/javascripts/lib/utils/users_cache.js @@ -8,16 +8,16 @@ class UsersCache extends Cache { } return Api.users('', { username }) - .then((users) => { - if (!users.length) { + .then(({ data }) => { + if (!data.length) { throw new Error(`User "${username}" could not be found!`); } - if (users.length > 1) { + if (data.length > 1) { throw new Error(`Expected username "${username}" to be unique!`); } - const user = users[0]; + const user = data[0]; this.internalStorage[username] = user; return user; }); |