aboutsummaryrefslogtreecommitdiff
path: root/src/components/user_search/user_search.js
diff options
context:
space:
mode:
authorShpuld Shpludson <shp@cock.li>2019-04-30 15:11:30 +0000
committerShpuld Shpludson <shp@cock.li>2019-04-30 15:11:30 +0000
commitb1bd5bd08eccbe93d37aa1708692cad50003fd58 (patch)
treede2de7d792a17ccd1ac74773cd05f3d18c2de60e /src/components/user_search/user_search.js
parentda08388d6af314fb298bae011da31bcfc8ac0a45 (diff)
parent0f7f685c5e720d870cc732f07f68fb6eac278a68 (diff)
Merge branch 'develop' into 'brendenbice1222/pleroma-fe-issues/pleroma-fe-202-show-boosted-users'
# Conflicts: # src/services/api/api.service.js
Diffstat (limited to 'src/components/user_search/user_search.js')
-rw-r--r--src/components/user_search/user_search.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/components/user_search/user_search.js b/src/components/user_search/user_search.js
index 55040826..62dafdf1 100644
--- a/src/components/user_search/user_search.js
+++ b/src/components/user_search/user_search.js
@@ -1,5 +1,6 @@
import FollowCard from '../follow_card/follow_card.vue'
-import userSearchApi from '../../services/new_api/user_search.js'
+import map from 'lodash/map'
+
const userSearch = {
components: {
FollowCard
@@ -10,10 +11,15 @@ const userSearch = {
data () {
return {
username: '',
- users: [],
+ userIds: [],
loading: false
}
},
+ computed: {
+ users () {
+ return this.userIds.map(userId => this.$store.getters.findUser(userId))
+ }
+ },
mounted () {
this.search(this.query)
},
@@ -33,10 +39,10 @@ const userSearch = {
return
}
this.loading = true
- userSearchApi.search({query, store: this.$store})
+ this.$store.dispatch('searchUsers', query)
.then((res) => {
this.loading = false
- this.users = res
+ this.userIds = map(res, 'id')
})
}
}