diff options
| author | HJ <30-hj@users.noreply.git.pleroma.social> | 2019-04-25 12:32:29 +0000 |
|---|---|---|
| committer | HJ <30-hj@users.noreply.git.pleroma.social> | 2019-04-25 12:32:29 +0000 |
| commit | e351f8630c74865eba520e109e395bf3f7e81864 (patch) | |
| tree | 55597f6800ffb0e8f4f56b9dae1801cd4a00bb2c /src/components/user_search/user_search.js | |
| parent | c8f967d5c0424c7dd504ad4afeaefb7c745eed31 (diff) | |
| parent | 445b54c55310802d561ab1438f8207b59d35d505 (diff) | |
Merge branch '492' into 'develop'
Fix Follow/Mute/Block not functional issue in the user search page
Closes #492
See merge request pleroma/pleroma-fe!754
Diffstat (limited to 'src/components/user_search/user_search.js')
| -rw-r--r-- | src/components/user_search/user_search.js | 14 |
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') }) } } |
