From 69f9ea987c2e1cda5ebb31b640ef42389fa8c210 Mon Sep 17 00:00:00 2001
From: taehoon
Date: Tue, 2 Apr 2019 13:49:48 -0400
Subject: [PATCH] make blocking functional in the search results
---
src/components/user_autosuggest/user_autosuggest.js | 5 +++--
src/components/user_autosuggest/user_autosuggest.vue | 2 +-
src/modules/users.js | 3 +++
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/components/user_autosuggest/user_autosuggest.js b/src/components/user_autosuggest/user_autosuggest.js
index b99f61cc..42914b36 100644
--- a/src/components/user_autosuggest/user_autosuggest.js
+++ b/src/components/user_autosuggest/user_autosuggest.js
@@ -1,11 +1,11 @@
-import BasicUserCard from '../basic_user_card/basic_user_card.vue'
+import BlockCard from '../block_card/block_card.vue'
import userSearchApi from '../../services/new_api/user_search.js'
const debounceMilliseconds = 500
export default {
components: {
- BasicUserCard
+ BlockCard
},
data () {
return {
@@ -28,6 +28,7 @@ export default {
if (query) {
userSearchApi.search({query, store: this.$store})
.then((data) => {
+ this.$store.dispatch('addNewUsers', data)
this.results = data
this.resultsVisible = true
})
diff --git a/src/components/user_autosuggest/user_autosuggest.vue b/src/components/user_autosuggest/user_autosuggest.vue
index 2840941f..d85fabf1 100644
--- a/src/components/user_autosuggest/user_autosuggest.vue
+++ b/src/components/user_autosuggest/user_autosuggest.vue
@@ -2,7 +2,7 @@
diff --git a/src/modules/users.js b/src/modules/users.js
index 6de50b80..545b1d58 100644
--- a/src/modules/users.js
+++ b/src/modules/users.js
@@ -281,6 +281,9 @@ const users = {
unregisterPushNotifications(token)
},
+ addNewUsers ({ commit }, users) {
+ commit('addNewUsers', users)
+ },
addNewStatuses (store, { statuses }) {
const users = map(statuses, 'user')
const retweetedUsers = compact(map(statuses, 'retweeted_status.user'))