summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/lib/utils/users_cache.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/lib/utils/users_cache.js')
-rw-r--r--app/assets/javascripts/lib/utils/users_cache.js8
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;
});