aboutsummaryrefslogtreecommitdiff
path: root/src/components/user_search/user_search.js
diff options
context:
space:
mode:
authorTae Hoon <th.dev91@gmail.com>2019-07-10 16:58:49 +0000
committerShpuld Shpludson <shp@cock.li>2019-07-10 16:58:49 +0000
commit532b76eb64119848d424d6d0d644a72d817fba59 (patch)
tree6fa46aa43455ce5df0a1ff64747083be8af1f924 /src/components/user_search/user_search.js
parent2f87540612e5e46b6cd0fb343d8f9bfdb0dad333 (diff)
Refactor user search api, better api error response handling
Diffstat (limited to 'src/components/user_search/user_search.js')
-rw-r--r--src/components/user_search/user_search.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/components/user_search/user_search.js b/src/components/user_search/user_search.js
index 62dafdf1..5c29d8f2 100644
--- a/src/components/user_search/user_search.js
+++ b/src/components/user_search/user_search.js
@@ -35,15 +35,13 @@ const userSearch = {
},
search (query) {
if (!query) {
- this.users = []
return
}
this.loading = true
+ this.userIds = []
this.$store.dispatch('searchUsers', query)
- .then((res) => {
- this.loading = false
- this.userIds = map(res, 'id')
- })
+ .then((res) => { this.userIds = map(res, 'id') })
+ .finally(() => { this.loading = false })
}
}
}